如何得知物理目录下的文件名称和子目录名称?

xyz2000 2000-04-28 05:47:00
设 server.mappath("./index.htm")得到
d:\aspfiles\index.htm
如何得到d:\下所有文件名称
要求给出原代码
...全文
92 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wfw 2000-06-13
  • 打赏
  • 举报
回复
用VB写一个dll 在DLL中调用dir不就得了
for123 2000-06-09
  • 打赏
  • 举报
回复
i know
Rock 2000-04-28
  • 打赏
  • 举报
回复
我用到一个组件:commerce.AdminFiles,它是Microsoft site server, commerce edition中附带的,可以单独使用.以下方法是我在程序中用的直接搬过来给你.如果组件找不到的话给我来信我给你一个.
方法如下:
'
' Get files in given folder
'
Public Function getFiles(ByVal strPathName As String, ByRef files)
' declare Cadminfiles obj variable
Dim inFiles
' set error handle
On Error Resume Next
Err.Clear

' Create new CAdminfiles object
Set oAdminFile = CreateObject("commerce.AdminFiles.1")
If Err.Number <> 0 Then
getFiles = False
Exit Function
End If

' Get the files in given folder
If right(strPathName, 1) <> "\" Then
strPathName = strPathName & "\"
End If
strPathName = strPathName & "*.*"
Err.Clear
inFiles = oAdminFile.getFiles(strPathName)
If Err.Number <> 0 Then
getFiles = False
Exit Function
End If

files = inFiles
getFiles = True

' Release the object
Set oAdminFile = Nothing
End Function

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧