如何判断文件夹里已存在某文件?

topend 2000-08-06 04:50:00
rt
...全文
108 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
huntout 2000-08-07
  • 打赏
  • 举报
回复
The following example illustrates use of the FileExists method:

Function ReportFileStatus(filespec)
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists."
Else
msg = filespec & " doesn't exist."
End If
ReportFileStatus = msg
End Function
river99 2000-08-06
  • 打赏
  • 举报
回复
还需要判断"."以及".."两个字符串
vcmfc 2000-08-06
  • 打赏
  • 举报
回复
到这个文件夹中进行FindFirstFile(),如何返回句柄无效就是不存在这个文件.

28,390

社区成员

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

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