Below code snippet will be helpful for checking whether the
Input file name contains any Invalid characters which a File name should not
contain.
public bool IsValidFilename(string testName)
{
return testName.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) == -1;
}
No comments:
Post a Comment