2022年8月1日

File,FileInfo 和 Directory,DirectoryInfo 的区别

摘要: 1.对比名称看,File和Directory 是一个类别,另外属于一个类别 2.File和Directory 提供的是静态方法;而另外2种 提供的是 实例方法 3.File是针对文件的,而Directory是针对文件夹的 综上:如果你写的软件是针对文件操作的,那么用带 Info的比较好,因为大量的静 阅读全文

posted @ 2022-08-01 18:05 泰坦尼克号上的活龙虾 阅读(244) 评论(0) 推荐(0)

记一次文件错误:"The process cannot access the file 'E:\TestFileManager\1.txt' because it is being used by another process"

摘要: 最开始写的: public bool WriteInFile(string path,string words) { //首先判断,path有没有该路径,没有 则创建 //【0】判断路径 if (!File.Exists(path)) { File.Create(path);//如果不存在就创建 } 阅读全文

posted @ 2022-08-01 16:48 泰坦尼克号上的活龙虾 阅读(223) 评论(0) 推荐(0)

导航