[导入]ASP常用函数:Del()

<%
'功能:FSO删除文件
'来源:http://jorkin.reallydo.com/article.asp?id=484
'需要Path函数:http://jorkin.reallydo.com/article.asp?id=401

Public Function Del(ByVal sFileName)
    
On Error Resume Next
    
Del = False
    
sFileName = Path(sFileName)
    
Dim oFSO
    Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
    
If oFSO.FileExists(sFileName) Then
        
oFSO.DeleteFile sFileName, True
        
Del = True
    End If
    Set
oFSO = Nothing
    If
Err.Number <> 0 Then
        
Err.Clear
        Del = False
    End If
End Function
%>


文章来源: http://Jorkin.Reallydo.Com/default.asp?id=484

你可能感兴趣的:(常用函数)