|
|
|
Click here to copy the following block |
Private Function EvalFileName(ByVal Name As String) As Boolean Dim i As Long Dim Test As String Const BAD_FILENAME_CHARS As String = """" & "/" & "\" & ":" & "|" & "<" & _ ">" & "*" & "?" If Len(Trim$(Name)) = 0 Then Exit Function End If Test = Right$(Name, 1) If Test = " " Or Test = "." Then Exit Function End If Test = BAD_FILENAME_CHARS For i = 0 To 31 Test = Test & Chr$(i) Next For i = 1 To Len(Name) If InStr(1, Test, Mid$(Name, i, 1)) > 0 Then Exit Function End If Next If LCase$(Name) = "con" Or LCase$(Name) = "prn" Or LCase$(Name) = "aux" Or _ LCase$(Name) = "clock$" Or LCase$(Name) = "nul" Then Exit Function End If For i = 1 To 9 If LCase$(Name) = "com" & CStr(i) Or LCase$(Name) = "lpt" & CStr(i) Then Exit Function End If Next EvalFileName = True
End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|