Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Replaces the invalid file name chars with "@" char.
- public static void ReplaceInvalidChars(ref string fileName) {
- char[] invalidChars = System.IO.Path.GetInvalidFileNameChars();
- for(int index = 0;index < invalidChars.Length;index++) {
- fileName = fileName.Replace(invalidChars[index],'@');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment