
操作文件
Dotnet专栏
公众号:Dotnet专栏
展开
-
C# 获取盘符可用大小
获取到的是字节,比如你想和 500M 相比,则boo bResult = GetHardDiskFreeSpace("C") > 500 * 1024 *1024;/// <summary> /// 获取磁盘空间大小(单位字节) /// </summary> /// <param name="str_HardDiskName">磁盘名称</param> /// <returns&原创 2022-05-11 15:46:40 · 867 阅读 · 0 评论 -
c# 打开文件夹并选中文件
下面展示一些 内联代码片。打开文件夹 string ExplorPath = "你的文件夹路径"; if (Directory.Exists(ExplorPath)) System.Diagnostics.Process.Start(ExplorPath);打开文件夹并选中某个文件 string ExplorPath = "你的文件夹路径"; string FilePath = "你的文件路径,需要带文件后缀"; if (Directory.Exists(ExplorPath)原创 2022-03-02 17:08:47 · 1837 阅读 · 0 评论