This code will show you how to check if a file format is right 
CODE:
If strFileName.Substring(strFileName.Length - 4, 4) <> ".doc" _ 
And strFileName.Substring(strFileName.Length - 4, 4) <> ".pdf" Then 
lblError.Text = "File must be a '.doc' or '.pdf' file. " & strFileName 
Return 
End If


0 comments:
Post a Comment