文件的读出 编辑 管理

2016-01-29 17:27 3 1 收藏

文件的读出 编辑 管理,文件的读出 编辑 管理

【 tulaoshi.com - ASP 】

  <%
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=# onclick=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=# onclick=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=# onclick=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=# onclick=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=# onclick=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<td width='45%'<a hr

来源:https://www.tulaoshi.com/n/20160129/1501401.html

延伸阅读
6.4 文件管理综合举例:文件管理器的实现 在本章的最后,我们利用Delphi提供的文件控件和文件管理函数开发一个简单的文件管理器。虽然这一文件管理器还无法和Windows提供的文件管理器相比拟,但它也为一般的文件操作提供了足够多的功能,而且如果读者感兴趣,还可以对它做进一步的扩充。在后边的拖放操作一章中,我们就为它提供了拖...
文件是同一类型元素的有序集合,是内存与外设间传输数据的渠道。一些外设如显示器、键盘、打印机等都可以看作文件,但最常用的还是磁盘文件,这也是本章我们主要讨论的对象。 Delphi继承了Object Pascal的文件管理功能,并有很大的发展,其中最主要的是提供了用于文件管理的标准控件,同时也提供了更多的文件管理函数。利用Delphi的强...
pdf文件怎么修改编辑 1、打开电脑中安装的PDF编辑器,然后选择文件-打开,选择需要处理图片的PDF电子文档,然后在软件中打开。 2、翻到需要修改图片的那一页。pdf文件在PDF编辑器中打开后,大家可以在软件左侧看到页面的缩略图,大家可以浏览缩略图然后快速选择需要修改的页面,然后软件右侧就会显示该页面的内容。 3、完...
标签: 电脑入门
1、打开我们需要保护的文件,点击,此时右侧会出现如下图所示的选项。 2、这里我们选择选定后,启动保护,弹窗会让你输入密码。 3、确定之后,成功开启保护模式,这时,无论你怎么操作,文件都无法进行操作,也就是说无法进行编辑、复制、粘贴等一系列操作。 4、如果你想解除保护,可以点击右边栏的输入密码,即可马上解锁!
标签: 电脑入门
我们都知道Powerpoint的文件是PPT格式的,但其实不然,有时为了让对方直接播放会保存为PPS文件,这样当双击PPS文件的时候就会直接播放了,所以这也使得有些人无法打开PPS文件进行编辑,这不今天就有人向我求助,说怎么才能编辑别人发过来的演示文稿,我一听就知道是PPS文件,那么PPS文件怎么打开及编辑呢,今天还是把具体步骤方法以及细节说明...

经验教程

968

收藏

88
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部