ASP和PHP都是可以删除自身的

yipeiwu_com6年前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 
%> 
这样也行@_@

相关文章

PHP中使用CURL伪造来路抓取页面或文件

复制代码 代码如下: // 初始化 $curl = curl_init(); // 要访问的网址 curl_setopt($curl, CURLOPT_URL, 'http://asen...

php上传excel表格并获取数据

这个是最近需要做的一个功能,在网上也查看了很多相关的文章,基本上大同小异,在这里整理一下。 一:首先是html部分 <html> <body> <for...

php生成4位数字验证码的实现代码

在php中实现验证码还是很方便的,关键点在于掌握php gd库与session的用法。 纵观网上php 生成验证码的例子,无不是php gd库与session相结合,并利用php 生成随...

php获得当前的脚本网址

//获得当前的脚本网址 function GetCurUrl(){     if(!empty($_SERVER["REQUEST_...

php递归创建目录的方法

本文实例讲述了php递归创建目录的方法,分享给大家供大家参考。 具体实现代码如下: <?php function mk_dir($path){ //第1种情况,该目录...