By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

Method to validate a file name

P: n/a
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.
Jun 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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 Nietzsche
Jun 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.