ASP和PHP都是可以删除自身的_php技巧
程序员文章站
2022-06-10 12:14:10
...
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
$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
%>
这样也行@_@
复制代码 代码如下:
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
复制代码 代码如下:
$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
%>