Web page This code is the most streamlined deletion method and can be flexibly applied according to the actual modification
' Program name: delfile.asp
' Key parameter: Struploadfiles file name
Example: <a href= "delfile.asp?" Action=test.rar > Delete test.rar file </a>
<%
Struploadfiles=trim (Request.QueryString ("Struploadfiles"))
Action=trim (Request.QueryString ("Action"))
Response.Write "Successfully removed <font color=red>" &strUploadFiles& "</font> file!"
Call DelFiles (Struploadfiles & "")
Sub DelFiles (Struploadfiles)
If struploadfiles= "" Then Exit Sub
Dim fso,arruploadfiles,i
Set fso = CreateObject ("Scripting.FileSystemObject")
Fso. DeleteFile (server. MapPath ("" & Struploadfiles))
Set FSO = Nothing
Response.Write "<script Language=javascript>alert (' successfully deleted file, will return to previous page! ');"
Response.Write "This.location.href= ' Javascript:history.back (); ' </SCRIPT> "
End Sub
%>