当前位置: 网学 > 编程文档 > ASP > 正文

FSO操作文件系统

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17
loadfolder.Subfolders
Dim fso_mes
fso_mes="<ol>"
for each objSubFolder in objSubFolders
fso_mes=fso_mes& "<li><b><a href=""default.asp?action=fso&this=top&path="&path&"/"&objSubFolder.name&"""><font color=blue>" & objSubFolder.name & "</font></a></b></li>"
next
set allfiles = uploadfolder.Files
for each fileitem in allfiles
fso_mes=fso_mes& "<li><a href=""default.asp?action=fso&this=file&path="&path&"/"&fileitem.Name&""">" & fileitem.Name & "</a></li>"
Next
fso_mes=fso_mes&"</ol>"
response.write(fso_mes)
response.write deltext(uploadPath,1)
End Function



''文件属性
Function filepro(name)
name=Replace(name,"//","/")
Dim whichfile
If InStr(1,name,":\")=0 Then
name=Replace(name,"\","/")
whichfile = server.mappath(name)
Else
name=Replace(name,"/","\")
whichfile=name
End If
Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.fileexists(whichfile) Then
response.write(warn_red("文件不存在或者无访问权限"))
Exit Function
End If
Dim f2,s_mess
Set f2 = fso.GetFile(whichfile)
s_mess = "<div class=""admin_post_form""><b><font color=""#00008b"">父目录:</font><a href=""default.asp?action=fso&this=top&path="&f2.parentfolder&""">"&f2.parentfolder&
"</a></b><br/>"
s_mess = s_mess & "文件名称:" & f2.name & "<br>"
s_mess = s_mess & "文件短路径名:" & f2.shortPath & "<br>"
s_mess = s_mess & "文件物理地址:" & f2.Path & "<br>"
s_mess = s_mess & "文件属性:" & f2.Attributes & "<br>"
s_mess = s_mess & "文件大小: " & f2.size & "<br>"
s_mess = s_mess & "文件类型: " & f2.type & "<br>"
s_mess = s_mess & "文件创建时间: " & f2.DateCreated & "<br>"
s_mess = s_mess & "最近访问时间: " & f2.DateLastAccessed & "<br>"
s_mess = s_mess & "最近修改时间: " & f2.DateLastModified&"<br/></div>"
response.write(s_mess)
If killint(Trim(request("type")),0,0,2)<>0 Then
showtext(whichfile)
End If
response.write deltext(whichfile,0)
End Function
''
SUB showtext(files)
dim iStr,adosText,strasp
set adosText=Server.CreateObject("ADODB.Stream")
adosText.mode=3
adosText.type=2
adosText.charset="gb2312"
''adosText.charset="big5"
adosText.open
If InStr(1,files,":\")=0 Then
files=Replace(files,"\","/")
files = server.mappath(files)
Else
files=Replace(files,"/","\")
files=files
End If
adosText.loadFromFile (files)
strasp=adosText.ReadText()
adosText.close
set adosText=nothing%>
<form method="post" class="admin_post_form" action="default.asp?action=fso&this=edit&mode=1">
<textarea id="txt" name="txt" rows="15" cols="60"><%=Server.HTMLEncode(strasp)%></textarea>
<label> <input name="path" type="hidden" value="<%=Trim(request("path"))%>"/><input type="submit" name="okedit" class="submit" value="确定编辑"> </label>
</form>
<%End Sub
Function deltext(file,mode)
Dim deltext_mess
deltext_mess="<div cl

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号