【www.gdgbn.com--php常用代码】

从网上兴致冲冲地下载了ASP源代码,准备学习研究的时候.
一打开文件,天书般的代码.很让人郁闷吧 :(
在网上是找到了解密的方法,得一个文件挨一个文件地
打开,复制,粘贴,解密,再复制,再粘贴,再保存......
如果一个ASP程序有几百个文件???
解决办法来了..
decode.asp
<% @Language="JavaScript" %>
<%
/*
*--------------- decode.asp -----------------
* 功能:遍历某个目录下的所有文件,对加密过的.asp文件
* 进行解密,并写入源文件中.
* 实例:单个文件解密
* Response.Write(DncodeFile(Server.MapPath("conn.asp")));
* 实例:目录下所有文件解密.
* DncodeFolderFiles(Server.MapPath("xml"))
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-17 11:31
*--------------- decode.asp -----------------
*/
function DncodeFile(sFilePath)
{
/*
*--------------- DncodeFile(sFilePath) -----------------
* DncodeFile(sFilePath)
* 功能:打开文件sFilePath,Encode解密,重写该文件.
* 参数:sFilePath,字符串,文件的路径.
* 返回:sFilePath,文件的路径.
* 实例:Response.Write(DncodeFile(Server.MapPath("conn.asp")));
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-17 0:58
*--------------- DncodeFile(sFilePath) -----------------
*/
var ForReading = 1, ForWriting =2, ForAppending =8;
var fso = Server.CreateObject("Scripting.FileSystemObject");
var f = fso.OpenTextFile(sFilePath,ForReading,true);
sFileText = f.ReadAll();
f.Close();
sDncodeText = strdec(sFileText)
var f = fso.OpenTextFile(sFilePath,ForWriting,true);
f.Write(sDncodeText);
f.Close();
//return sDncodeText;
return sFilePath;
}
function GetFilesPath(sFolderPath)
{
/*
*--------------- GetFilesPath(sFolderPath) -----------------
* GetFilesPath(sFolderPath)
* 功能:遍历sFolderPath目录下的所有文件.返回数组.存储文件路径.

本文来源:http://www.gdgbn.com/jiaocheng/3077/