File Name Validator

  • Thread starter Thread starter Brahm
  • Start date Start date
B

Brahm

Hi Folks,

do you know a file name validator ?

I am reading a text file and I am creating new files in runtime. In some
cases it is found string with invalid characters so. I
have errors.

I was able to avoid the problem with this character "/"

Is there anything peace of code already ready for this ?

Any help is appreciated.

Thanks.
 
Brahm,

You can use the System.IO.Path class.

Path.GetFileName will throw an exception if the filename contains invalid
characters.

Kerry Moorman
 
Back
Top