{"id":610,"date":"2020-02-24T16:05:33","date_gmt":"2020-02-24T07:05:33","guid":{"rendered":"https:\/\/todosoft.net\/blog\/?p=610"},"modified":"2021-03-14T05:39:27","modified_gmt":"2021-03-13T20:39:27","slug":"post-610","status":"publish","type":"post","link":"https:\/\/todosoft.net\/blog\/?p=610","title":{"rendered":"\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u30fb\u30d5\u30a1\u30a4\u30eb\u540d \u4f7f\u7528\u7981\u6b62\u6587\u5b57\u306e\u7f6e\u63db"},"content":{"rendered":"\n<pre class=\"wp-block-luxe-blocks-syntaxhighlighter line-numbers language-csharp\"><code class=\"language-csharp\">\/\/\/ &lt;summary>\n\/\/\/ \u4f7f\u7528\u7981\u6b62\u6587\u5b57\u306e\u7f6e\u63db\n\/\/\/ &lt;\/summary>\n\/\/\/ &lt;param name=\"strData\">&lt;\/param>\n\/\/\/ &lt;returns>&lt;\/returns>\nprivate static string ReplaceInvalidChar(string strData)\n{\n    string strResult = strData;\n\n    foreach (char invalidChar in Path.GetInvalidFileNameChars())\n    {\n        while (strResult.IndexOf(invalidChar) >= 0)\n        {\n            strResult = strResult.Remove(strResult.IndexOf(invalidChar), 1);\n        }\n    }\n\n    List&lt;string> arrayReplaceChar = new List&lt;string> { \"*\", \"\/\", \"&amp;\", \"\"\", \"\\\", \"\n\", \"\n\", \"\t\", \"&lt;\", \">\", \"[\", \"]\", \"{\", \"}\", \"|\", \":\", \";\", \"?\", \"!\", \",\", \".\", \"=\", \"~\", \"$\", \"%\" };\n\n    foreach (string strReplaceChar in arrayReplaceChar)\n    {\n        strResult = strResult.Replace(strReplaceChar, \"\");\n        strResult = strResult.Replace(Strings.StrConv(strReplaceChar, VbStrConv.Wide), \"\");\n    }\n\n    strResult = strResult.Trim(' ');\n\n    return strResult;\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,15],"tags":[76,77,78],"class_list":["post-610","post","type-post","status-publish","format-standard","hentry","category-c","category-15","tag-76","tag-77","tag-78"],"_links":{"self":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=610"}],"version-history":[{"count":5,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":689,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/610\/revisions\/689"}],"wp:attachment":[{"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/todosoft.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}