Click here to Skip to main content
15,891,431 members
Articles / Programming Languages / C#

Removing characters which are not allowed in Windows filenames

Rate me:
Please Sign up or sign in to vote.
4.93/5 (20 votes)
13 Apr 2014CPOL 91.1K   26  
Sometimes, I need to create files or folders directly, and use existing data to provide the file name - and then my app throws an exception because there are "illegal characters in the file name" - so this is a simple way to remove them.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
Wales Wales
Born at an early age, he grew older. At the same time, his hair grew longer, and was tied up behind his head.
Has problems spelling the word "the".
Invented the portable cat-flap.
Currently, has not died yet. Or has he?

Comments and Discussions