冒险解谜游戏中文网 ChinaAVG
标题:
[VB Code]FindFileExst Module
[打印本页]
作者:
firendless
时间:
2009-3-19 08:09
标题:
[VB Code]FindFileExst Module
一个Module,便于查找文件,dir函数不适用的情况下,此函数比较便捷。
/ u9 \6 s& }8 `, r. h
拿的M$的eg,修改了一下,效果还可以。支持网络上的文件。
z4 S. U r" O6 [ t& p: o
'by Firendless at 090319
'www.promiseforever.com
Option Explicit
Private Declare Function OpenFile _
Lib "kernel32" (ByVal lpFileName As String, _
lpReOpenBuff As FirFile, _
ByVal wStyle As Long) As Long
Private Type FirFile
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName(128) As Byte
End Type
Public Function CheckFileExist(strSearchFile As String) As Boolean
If strSearchFile = "" Then
CheckFileExist = False
Exit Function
End If
Dim lngResult As Long
Dim strFileBuff As FirFile
lngResult = OpenFile(strSearchFile, strFileBuff, &H4000)
If lngResult = -1 Then
CheckFileExist = False
Exit Function
Else
CheckFileExist = True
Exit Function
End If
End Function
复制代码
作者:
shane007
时间:
2009-3-19 11:14
学习了
欢迎光临 冒险解谜游戏中文网 ChinaAVG (https://chinaavg.com/)
Powered by Discuz! X3.2