Hi,
You could use a regular expression for that. This example requires
the path so c:\test.txt will work but test.txt will not. Take a look at
regexlib.com for more examples.
Dim regFileName As New System.Text.RegularExpressions.Regex( _
"^([a-zA-Z]\:)(\\[^\\/:*?<>""|]*(?<![ ]))*(\.[a-zA-Z]{2,6})$")
Dim strOut As String = IIf(regFileName.IsMatch(TextBox1.Text), "Valid",
"Invalid").ToString
MessageBox.Show(strOut)
http://www.regexlib.com/REDetails.aspx?regexp_id=357
Ken
-----------------------
"tranky" <NO****@THANKY.YOU> wrote in message
news:fg*********************@news3.tin.it...
HI....
In my vb.net project the user can insert into an imputbox a filename.
In what manner i can check the filename, so that will be accepted in a
Windows System? (i want that inside of the filename there isn't ";" , "*" ,
and all the charachters that windows doesn't accept...).I think is a bad
idea to use the Instr function for all that charachters.
I hope in your ideas.
from italy thank you.