- 重命名文件FileSystem.Rename(oldpathname,newpathname)
- 获取文件数组(可以进行限定):Directory.GetFiles(FilePath,"*")
- 获取文件夹数组 Directory.GetDirectories(filepath,"*")
- Dir(path,vbDirectory) 获取指定文件夹下第一个文件名
- 拷贝整个文件夹:
My.Computer.FileSystem.CopyDirectory("
原目录", "目标目录", True)
- 移动整个文件夹:Directory.Move("E:\111\222","E:\111\333\1")
- 获取文件扩展名System.IO.Path.GetExtension(filepath)
- 获取文件名System.IO.Path.GetFileName(filepath)
- 获取文件名不带扩展System.IO.Path.GetFileNameWithoutExtension(filepath)
- 获取文件所在根目录System.IO.Path.GetPathRoot(filepath)
- 取两个集合的交集: SumSheets.Intersect(workBookSheets)
- 获取文件文件夹是否存在System.IO.Directory.Exists(Str_Path) System.IO.File.Exists(Str_File)
- 获取桌面路径Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
- 判断文件是否存在Dir(path,vbDirectory)
- 复制文件到另一个文件夹下My.Computer.FileSystem.CopyDirectory(filename, filenmae, True)
- 迭代获取文件名
f=My.Computer.FileSystem.GetFiles(path,FileIO.SearchOption.SearchAllSubDirectories,"*.*")
f的类型