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-app开发接口加密详解

自己平时工作中用到的一套接口加密规则,记录下来以后用: /** inc 解析接口 客户端接口传输规则: 1.用cmd参数(base64)来动态调用不同的接口,接口地址统一为 htt...

最新的php 文件上传模型,支持多文件上传

复制代码 代码如下:<?php class UploadModel { protected $keys; protected $err = array(); protected $...

win7安装php框架Yii的方法

本文讲述了win7安装php框架Yii的方法。分享给大家供大家参考,具体如下: 有人问我win7安装yii老是报错,花了10分钟装了一下,现在做程序的自学能力这么差了?我对框架这些东西不...

php常用字符函数实例小结

本文实例总结了php常用字符函数。分享给大家供大家参考,具体如下: 1. string substr(string  $string, int $start &nbs...

PHP获取中英混合字符串长度的方法

今晚在写框架的表单验证类时,需要判断某个字符串长度是否在指定区间内,很自然地,想到了PHP中的strlen函数。复制代码 代码如下:$str = 'Hello world!';echo...