Method to validate a file name

  • Thread starter Thread starter Gaetan
  • Start date Start date
G

Gaetan

I have a web application where the user can type the name of a file name in a field. I want to make
sure the syntax of that filename is valid before using it.

I browsed the methods in various .Net 2.0 framework assemblies and there does not seem to be any to
validate the syntax of a string representing a filename.

Is there a method I can use to validate the syntax of a NTFS file name?

regards,

Gaetan.
 
Hello Gaetan,

Use RegExp for this

G> I have a web application where the user can type the name of a file
G> name in a field. I want to make sure the syntax of that filename is
G> valid before using it.
G>
G> I browsed the methods in various .Net 2.0 framework assemblies and
G> there does not seem to be any to validate the syntax of a string
G> representing a filename.
G>
G> Is there a method I can use to validate the syntax of a NTFS file
G> name?
G>
G> regards,
G>
G> Gaetan.
G>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsch
 
Back
Top