<%
'这里一定要完整的绝对路径,前面再加上“\?”
'delfolder "\?E:wwwliuhecai."'删除文件夹
'delfile "\?E:wwwuserliuhecai.index.asp教程"'删除文件
function Delfolder(t0)
'On Error Resume Next
Set fso=Server.CreateObject("Scripting.FileSystemObject")
If Instr(t0,":")>0 Then
f0=t0
Else
f0=Server.MapPath(t0)
End If
'IF fso.FolderExists(f0) Then
fso.DeleteFolder f0,true'加上true,强制删除只读属性的文件夹
IF Err Then Response.write Err.Description:Err.Clear
End Function
function Delfile(t0)
'On Error Resume Next
Set fso=Server.CreateObject("Scripting.FileSystemObject")
If Instr(t0,":")>0 Then
f0=t0
Else
f0=Server.MapPath(t0)
End If
'IF fso.FileExists(f0) Then
fso.DeleteFile f0,true'加上true,强制删除只读属性的文件
IF Err Then Response.write Err.Description:Err.Clear
End function
%>
时间: 2024-10-30 12:50:59