.NET ez 2012-04-18
假如要儲存的檔案名稱,包含特殊字元會造成無法儲存,只需透過 Path.InvalidPathChars 即可查出特殊字元,就可去除瞜。
foreach (char c in Path.InvalidPathChars) DatName = "檔案名稱".Replace(c.ToString(), "").Trim();
標籤: .NET
本文章網址:
https://www.ez2o.com/Blog/Post/csharp-FileName-Special-Characters-Removed
https://www.ez2o.com/Blog/Post/139
https://www.ez2o.com/Blog/Post/csharp-FileName-Special-Characters-Removed
https://www.ez2o.com/Blog/Post/139