private static string CreateValidFileName( string Filename )
{string invalidChars = Regex.Escape( new string( Path.GetInvalidFileNameChars() ) );
string invalidReStr = string.Format( @"[{0}]+", invalidChars );
return Regex.Replace( Filename , invalidReStr, "_" );}
Search This Blog
Wednesday, May 4, 2011
Removing invalid characters from file name and making file valid.
Subscribe to:
Post Comments (Atom)
Featured Posts
Discover powerful tools for digital investigations, IP intelligence, threat hunting, exposed services, data breach research and satellite imagery.
14 Powerful OSINT Tools for Cybersecurity | BytesXplorer </> Bytes Xplorer TECHNOLOGY • ...
-
public struct CoOrds { public int x, y; public CoOrds( int p1, int p2) { x = p1; y = p2; } }
-
LM Studio Overview LM Studio is a desktop application designed for developing and experimenting with large language models (LLMs)...
Where do Regex, Path come from?
ReplyDelete