文件、目录,文本文件等多种操作类

一个使用fso的class,前面的文章也有提到。这里有比较多的一些实例。
<%
Dim MyFileFolder
Set MyFileFolder = New FileFolderCls
''Response.Write MyFileFolder.MoveAFile("f:\123\4561.exe","f:\123\4562.txt")
''Response.Write MyFileFolder.MoveAFolder("f:\456","f:\ditg\456")
''Response.Write MyFileFolder.ShowFileSystemType("i:\")
''Response.Write MyFileFolder.CopyAFile("f:\123\4562.txt","f:\123\4563.txt")
''!!!!
''Response.Write MyFileFolder.CopyAFolder("f:\123\","f:\789\")
''Response.Write MyFileFolder.ShowFolderList("f:\ditg")
''Response.Write MyFileFolder.ShowFileList("f:\123\123")
''Response.Write MyFileFolder.DeleteAFile("f:\123\4562.txt")
''Response.Write MyFileFolder.DeleteAFolder("f:\456\")
''Response.Write MyFileFolder.CreateFolderDemo("f:\147\")
''Response.Write MyFileFolder.GetFileSize("f:\123\4563.txt")
''Response.Write MyFileFolder.GetFolderSize("f:\123\123.txt")
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",1)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",2)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",3)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",4)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",5)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",6)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",7)&"<br>"
''Response.Write MyFileFolder.ShowFileAccessInfo("f:\123\123.txt",8)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",1)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",2)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",3)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",4)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",5)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",6)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",7)&"<br>"
''Response.Write MyFileFolder.ShowFolderAccessInfo("f:\123\",8)&"<br>"
''Response.Write MyFileFolder.WriteTxtFile("f:\123\cexo.txt","",1)&"<br>"
''Response.Write MyFileFolder.WriteTxtFile("f:\123\cexo.txt","cexowxfdw",1)&"<br>"
''Response.Write MyFileFolder.WriteTxtFile("f:\123\cexo.txt",Chr(13)&Chr(10)
&"cexowxfdw",2)&"<br>"
''Response.Write MyFileFolder.ReadTxtFile("f:\123\cexo.txt")&"<br>"
Response.Write MyFileFolder.DisplayLevelDepth("F:\ditg\ditg\bumen\images")&"<br>"
Class FileFolderCls
Public fso
Private Sub Class_Initialize()
Set fso = CreateObject("Scripting.FileSystemObject")

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3629.html