这个目前还是有个别无法显示,翻了下msdn貌似没看到更好的解决方案,暂时放弃继续研究,有晓得完全解决的朋友不妨回复说一声。
先附bat创建畸形目录,以下代码复制另存为a.bat:
复制代码 代码如下:
md aux\\
md com1\\
md com2\\
md prn\\
md con\\
md nul\\
md dot...\\
md onedot..\\
程序代码
复制代码 代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
option explicit
response.charset = "UTF-8"
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
'***************************
'名称:目录列表类
'作者:逸品
'日期:2010-4-28
'网址:www.jb51.net
'描述:目录列表类,支持畸形目录名
'***************************
Class FsoCls
Private Fso
Public FsoObj
Private Sub Class_Initialize
Set Fso=CreateObject("Scripting.FileSystemObject")
Set FsoObj=Fso
End Sub
Private Sub Class_Terminate
Set Fso=Nothing
Set FsoObj=Nothing
End Sub
Function IsFolderExists(FolderPath)
If fso.FolderExists(FolderPath) Then
IsFolderExists = true
Else
IsFolderExists = false
End If
End Function
Function FolderItem(ByVal FolderDir)
If Instr(FolderDir,":\")>0 Then
FolderDir="\\?\"&FolderDir&"\"
Else
FolderDir="\\?\"&Server.MapPath(FolderDir)&"\"
End If
If IsFolderExists(FolderDir) = False Then
FolderItem=False
Exit Function
End if
Dim FolderObj,FolderList,F,i
i=1
Set FolderObj=Fso.GetFolder(FolderDir)
Set FolderList=FolderObj.SubFolders
FolderItem="目录总数:"&FolderObj.SubFolders.Count&"<hr>" & vbcrlf
FolderItem=FolderItem&"文件总数:"&FolderObj.Files.count&"<hr>" & vbcrlf
For Each F In FolderList
'Response.Write F.ShortName
'Response.Write (instr(1,F.ShortName,"~",1))
If IsFolderExists(FolderDir&F.Name) = True Then Response.Write ("T<br>" & vbcrlf)
If(instr(1,F.Name,".",0)>0) Then
Response.Write ("T")
F.Name=Replace(F.Name,".","-")
End if
FolderItem=FolderItem&i&"├─文件夹→"&F.Name&"<br>" & vbcrlf
i=i+1
Next
Set FolderList=Nothing
Set FolderObj=Nothing
End Function
End Class
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>目录列表类 支持畸形目录名</title>
</head>
<body>
<%
Dim F: Set F = new FsoCls
Response.write F.FolderItem("/")
%>
</body>
</html>
先附bat创建畸形目录,以下代码复制另存为a.bat:
复制代码 代码如下:
md aux\\
md com1\\
md com2\\
md prn\\
md con\\
md nul\\
md dot...\\
md onedot..\\
程序代码
复制代码 代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
option explicit
response.charset = "UTF-8"
session.codepage = 65001
session.timeout = 1440
server.scripttimeout = 9999
'***************************
'名称:目录列表类
'作者:逸品
'日期:2010-4-28
'网址:www.jb51.net
'描述:目录列表类,支持畸形目录名
'***************************
Class FsoCls
Private Fso
Public FsoObj
Private Sub Class_Initialize
Set Fso=CreateObject("Scripting.FileSystemObject")
Set FsoObj=Fso
End Sub
Private Sub Class_Terminate
Set Fso=Nothing
Set FsoObj=Nothing
End Sub
Function IsFolderExists(FolderPath)
If fso.FolderExists(FolderPath) Then
IsFolderExists = true
Else
IsFolderExists = false
End If
End Function
Function FolderItem(ByVal FolderDir)
If Instr(FolderDir,":\")>0 Then
FolderDir="\\?\"&FolderDir&"\"
Else
FolderDir="\\?\"&Server.MapPath(FolderDir)&"\"
End If
If IsFolderExists(FolderDir) = False Then
FolderItem=False
Exit Function
End if
Dim FolderObj,FolderList,F,i
i=1
Set FolderObj=Fso.GetFolder(FolderDir)
Set FolderList=FolderObj.SubFolders
FolderItem="目录总数:"&FolderObj.SubFolders.Count&"<hr>" & vbcrlf
FolderItem=FolderItem&"文件总数:"&FolderObj.Files.count&"<hr>" & vbcrlf
For Each F In FolderList
'Response.Write F.ShortName
'Response.Write (instr(1,F.ShortName,"~",1))
If IsFolderExists(FolderDir&F.Name) = True Then Response.Write ("T<br>" & vbcrlf)
If(instr(1,F.Name,".",0)>0) Then
Response.Write ("T")
F.Name=Replace(F.Name,".","-")
End if
FolderItem=FolderItem&i&"├─文件夹→"&F.Name&"<br>" & vbcrlf
i=i+1
Next
Set FolderList=Nothing
Set FolderObj=Nothing
End Function
End Class
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>目录列表类 支持畸形目录名</title>
</head>
<body>
<%
Dim F: Set F = new FsoCls
Response.write F.FolderItem("/")
%>
</body>
</html>
标签:
特殊文件夹
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“ASP FSO显示特殊文件夹的实现代码(畸形目录名、UNC路径)”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。