Home>Article>Backend Development> Share asp fso delete file DeleteFile and folder DeleteFolder example code

Share asp fso delete file DeleteFile and folder DeleteFolder example code

零下一度
零下一度 Original
2017-05-22 14:15:53 3033browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn