C#创建目录,文件名过滤特殊字符串,非法字符

时间:2016-12-11 01:35:32   收藏:0   阅读:1663
string invalid = new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars());

foreach (char c in invalid)
{
    illegal = illegal.Replace(c.ToString(), ""); 
}

 

原文:http://www.cnblogs.com/x-poior/p/6158541.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!