Link to home
Create AccountLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

How to compare a value returned by fileupload to ensure it contains 1 of 4 possible filename values (ASP.NET using C#) ?

I am developing an ASP.NET application using C# and .Net Framework 4.0.

I employ the following statement to retrieve the value returned from a browse by the user:

txtFilename.Text = FileUpload2.PostedFile.FileName;

How would you compare the value contained in txtFilename.Text to ensure that it contains one of the following 4 values keeping in mind that txtFilename.Text is prefaced by a drive:
1) MonthlyChecks.txt 2) ML1.txt 3) OS_Mastfile.txt 4) ReversePositive.txt
ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account