asp fso tutorial: ASP Delete method The delete method deletes the specified file or folder. This article asks you to share the example code of asp fso to delete files DeleteFile and folder DeleteFolder.
asp fso delete file DeleteFile and folder DeleteFolder
'============================== '函 数 名:DelFolder '作 用:删除文件夹 '参 数:文件夹相对路径FolderPath '============================== Function DelFolder(FolderPath) If IsFolder(FolderPath)=True Then Set Fso=Server.CreateObject("Scri"&"pting.File"&"Sys"&"temObject") Fso.DeleteFolder(Server.MapPath(FolderPath)) Set Fso=Nothing End If ' Select Case Err ' Case 424 Response.Write("方卡错误提示:删除"&FolderPath&"文件夹时,路径未找到或者该目录没有写入权限!") ' End Select End Function
'============================== '函 数 名:DelFile '作 用:删除文件 '参 数:文件相对路径FilePath '============================== Function DelFile(FilePath) ' On Error Resume Next If IsFile(FilePath)=True Then Set Fso=Server.CreateObject("Scri"&"pting.File"&"Sys"&"temObject") Fso.DeleteFile(Server.MapPath(FilePath)) Set Fso=Nothing End If ' Select Case Err ' Case 424 Response.Write("方卡错误提示:删除"&FilePath&"文件时,路径未找到或者该目录没有写入权限!") ' End Select End Function
[Related recommendations]
1. Summary asp fso tutorial--ASP Delete method
2. asp Deltextfile deletes the specified file in the specified folder instance tutorial
The above is the detailed content of Share asp fso delete file DeleteFile and folder DeleteFolder example code. For more information, please follow other related articles on the PHP Chinese website!