Revision: 46695
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at May 23, 2011 17:21 by liupengf12
Initial Code
private static string MakeValidFileName( string name )
{
string invalidChars = Regex.Escape( new string( Path.GetInvalidFileNameChars() ) );
string invalidReStr = string.Format( @"[{0}]+", invalidChars );
return Regex.Replace( name, invalidReStr, "_" );
}
Initial URL
http://stackoverflow.com/questions/309485/c-sanitize-file-name
Initial Description
Initial Title
Make Sanitize File Name
Initial Tags
Initial Language
C#