1、文件: File.Create(path) File.Copy(sourceFile,destFile,true); File.Move(sourceFile,targetFile) File.Exists(fileName)
File.Delete(fileName)
FileInfo fi = new FileInfo(fileName); fi.Delete();
2、文件夹: Directory.CreateDirectory(targetPath); Directory.Exists(path) Directory.Delete(path) Directory.Move(sourcePath, targetPath);
DirectoryInfo di = new DirectoryInfo(path); di.Delete(true);
3、文件夹拷贝需要遍历,逐个拷贝文件。