标题: [转帖]关于FSO删除文件或文件夹 [打印本页] 作者: 叛逆ぁ太上皇 时间: 2010-1-18 07:05 标题: [转帖]关于FSO删除文件或文件夹 关于FSO删除文件或文件夹dim fso=server.createobject("script.fileSystemObject") if fso.folderexists(Server.MapPath(filename)) then fso.deleteFolder(Server.MapPath(filename)) end if 删除文件 if fso.FileExists(Server.MapPath(filename)) then fso..DeleteFile(Server.MapPath(filename)) end if 删除文件函数: Function DeleFile(FilePath) On Error Resume Next Set Del=Server.CreateObject("Scripting.FileSystemObject") if Err <> 0 Then DelFile="该空间不支持FSO组件或者文件路径错误!" else if InStr(FilePath, ",") > 0 then FilePath=Split(FilePath,",") For i = 0 to ubound(FilePath) If Del.FileExists(Server.MapPath(FilePath))=True Then Del.DeleteFile Server.MapPath(FilePath(i)),true Next Else If Del.FileExists(Server.MapPath(FilePath))=True Then Del.DeleteFile Server.MapPath(FilePath),true End if End if Set Del=Nothing End Function作者: 彬彬有礼 时间: 2010-3-18 02:05
我刚来~~~嘿嘿~~