当前位置:首页 > ASP教程 > 应用技巧

原来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 
%> 


这样也行@_@
【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!