ASP和PHP删除自身的程序
z.asp<%s= Server.MapPath("z.asp")
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(s) Then
fso.Deletefile(s)
End If
Set fso = Nothing
%> z.php<?php
$file = "z.php";
if (file_exists($file)) {
@unlink ($file);
}
?> 运行一下,自己被删除了,不存在了...<%
s2= Server.MapPath("z2.asp")
s= Server.MapPath("z.asp")
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile s2,s
Set fso = Nothing
%> 这个某些场合还是需要的,运行过,立马删除
页:
[1]