惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - 太阳底下淋雨

amd显卡的问题 防止WindowChrome控件遮挡下面的控件 win11右键子菜单展开增加延时 [转]Git清除贡献者信息和历史提交记录,将开源项目拉取二次开发时可用到 判断是否为隐藏文件 快速查询python项目使用了哪些第三方库 C#操作超长路径文件时异常的处理 win11使用传统右键菜单 WPF中自定义按钮实现最大化最小化动画过度效果 Excel文件中嵌入自定义功能区customUI.xml文件后,如何进行修改 Excel中得到合并单元格的信息 WPF中文字发虚的问题解决 文件没有读取权限造成的File.Exists结果为false js如何判断当前页面是否处于激活状态 WinForm使用发布方式进行安装的安装目录 SqlServer使用row_number()分页 EF强类型查询本身部分字段时的处理 Dapper实现Like参数化 winform恢复窗口前端显示
C#删除路径到回收站
太阳底下淋雨 · 2024-04-24 · via 博客园 - 太阳底下淋雨

引用命名空间

Microsoft.VisualBasic.FileIO

string path = "文件或文件夹路径";
// 检查指定路径是文件还是目录
if (File.Exists(path))
{
    FileSystem.DeleteFile(path, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
}
else if (Directory.Exists(path))
{
    FileSystem.DeleteDirectory(path, UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin);
}

posted @ 2024-04-24 17:49  太阳底下淋雨  阅读(133)  评论(0)    收藏  举报