Okay here you go...
full code to check file name.
'place a textbox on form write text into it and then press button 1
'place this code in the button1_click event to check that the filename
entered in textbox 1 is fine
Dim uservalue As String
uservalue = TextBox1.Text
Dim b As Boolean = False
b = uservalue.Contains("/") Or uservalue.Contains("?") _
Or uservalue.Contains(":") _
Or uservalue.Contains("*") _
Or uservalue.Contains("""") _
Or uservalue.Contains("<") _
Or uservalue.Contains(">") _
Or uservalue.Contains("|") _
Or uservalue.Contains("?")
If b = False Then
MsgBox("Valid Filename")
Else
MsgBox("Invalid Filename")
End If
By the way this is the long way (not that long is it?)
Anyway hope this helps
Regards
Adam