關於visual basic6.0 [10點]

2007-12-14 4:11 am
我想問, 如果, 要求user打file name, 之後read file,

但係果個file 係唔存在, not exist既

有冇辦法check到? 之後有個msgbox彈出黎話比user知file not exist.


我想要個 程式碼. 麻煩哂

回答 (1)

2007-12-14 7:00 am
✔ 最佳答案
當然有方法, 例子如下,
Dim fso As FileSystemObject
Dim sFilePath As String

Set fso = New FileSystemObject

sFilePath = "c:\test.txt"
If fso.FileExists(sFilePath) Then
MsgBox "File Exist."
Else
MsgBox "File Doesn't Exist."
小弟現時將自己答過的問題及一些關於電腦的知識, 輯錄上小弟的博客, 請大家多多支持.

http://1erp-expert.b logspot.com/


收錄日期: 2021-04-27 15:00:07
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20071213000051KK03145

檢視 Wayback Machine 備份