- Option Explicit
-
- ' Publié par 69VobD3 (DivX-Paradise.net)
-
- Public Const gstrQUOTE$ = """"
- Public Const gstrSEP_DIR$ = "\"
-
-
- Public Function FileExists(ByVal strPathName As String) As Boolean
- Dim intFileNum As Integer
- On Error Resume Next
- strPathName = strUnQuoteString(strPathName)
- If Right$(strPathName, 1) = gstrSEP_DIR Then
- strPathName = Left$(strPathName, Len(strPathName) - 1)
- End If
- intFileNum = FreeFile
- Open strPathName For Input As intFileNum
- FileExists = (Err.Number = 0)
- Close intFileNum
- Err.Clear
- End Function
-
- Public Function strUnQuoteString(ByVal strQuotedString As String)
- strQuotedString = Trim$(strQuotedString)
- If Mid$(strQuotedString, 1, 1) = gstrQUOTE Then
- If Right$(strQuotedString, 1) = gstrQUOTE Then
- strQuotedString = Mid$(strQuotedString, 2, _
- Len(strQuotedString) - 2)
- End If
- End If
- strUnQuoteString = strQuotedString
- End Function
Option Explicit
' Publié par 69VobD3 (DivX-Paradise.net)
Public Const gstrQUOTE$ = """"
Public Const gstrSEP_DIR$ = "\"
Public Function FileExists(ByVal strPathName As String) As Boolean
Dim intFileNum As Integer
On Error Resume Next
strPathName = strUnQuoteString(strPathName)
If Right$(strPathName, 1) = gstrSEP_DIR Then
strPathName = Left$(strPathName, Len(strPathName) - 1)
End If
intFileNum = FreeFile
Open strPathName For Input As intFileNum
FileExists = (Err.Number = 0)
Close intFileNum
Err.Clear
End Function
Public Function strUnQuoteString(ByVal strQuotedString As String)
strQuotedString = Trim$(strQuotedString)
If Mid$(strQuotedString, 1, 1) = gstrQUOTE Then
If Right$(strQuotedString, 1) = gstrQUOTE Then
strQuotedString = Mid$(strQuotedString, 2, _
Len(strQuotedString) - 2)
End If
End If
strUnQuoteString = strQuotedString
End Function