请问 怎么判断该文件已经打开。。 如何判断 用api写 请提供例子 谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只有一个勉强的办法打开文件读写,如果没有别的程序打开,应该能读写'*********************************************************'* 名称:FileExists%(filename$)'* 功能:此函数用于判断文件是否存在'* 用法:FileExists%('文件名称')'* 文件不存在返回 0'*********************************************************Function FileExists%(filename$) Dim F% On Error Resume Next F% = FreeFile Open filename$ For Input As #F% Close #F% FileExists% = Not (Err <> 0)End Function 你的程序我帮你更改了一下,你自己看看吧!运行以后FileExists=1表示打开成功!FileExists=0表示打开不成功!Function FileExists%(filename$) Dim F% On Error goto Err: F% = FreeFile Open filename$ For Input As #F% Close #F% FileExists=1 exit subErr:FileExists=0End Function 类的问题 autocad二次开发,关于接口问题?//// 不爽.没说的.散. 如果在VB里制作DLL文件 如何在窗体中获得所有控件的值? 使用“文件”对话框,另存时 怎样使ActiveX Dll 中包含的窗体以无模式窗体显示? 请问怎样用vb做一个类似网络蚂蚁软件一样的多线程下载软件! 急,请教高手,谢谢! VB里面我最菜? 如何在某一窗口中使鼠标呈“+”型 我用recordset 取出的记录集为什么它的recordcount为什么总显示为-1?
'*********************************************************
'* 名称:FileExists%(filename$)
'* 功能:此函数用于判断文件是否存在
'* 用法:FileExists%('文件名称')
'* 文件不存在返回 0
'*********************************************************
Function FileExists%(filename$)
Dim F%
On Error Resume Next
F% = FreeFile
Open filename$ For Input As #F%
Close #F%
FileExists% = Not (Err <> 0)
End Function
你自己看看吧!
运行以后
FileExists=1表示打开成功!
FileExists=0表示打开不成功!
Function FileExists%(filename$)
Dim F%
On Error goto Err:
F% = FreeFile
Open filename$ For Input As #F%
Close #F%
FileExists=1
exit sub
Err:
FileExists=0
End Function