Error: Unable to write to destination
我想到的解決辦法是, 先放到一個暫存的資料夾, 再搬到有中文的真正的目的地, 即可, 所以要先判斷輸出的資料夾, 是否包含中文, 附件 Asp 用的檢查副程式.
'// RegExp Test.
Function RegExpTest(byval patrn, byval str)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
RegExpTest = regEx.Test(str)
End Function
'// 檢查文字中是否有中文字
'// ex: ret = IsMatchChinese(str)
'// return:
'// True: find.
'// False: not found.
Function IsMatchChinese(byval str)
IsMatchChinese = RegExpTest("[一-龥]+",str)
End Function
呼叫的範例如下:
if IsMatchChinese(output_filepath) then
response.write "<br/>bingo, match chinese folder..."
else
response.write "<br/>ok, not chinese folder continue..."
end if
聽說 Asp.Net 的範例如下, 還沒測試過:
Regex ex = new Regex("[一-龥]");
bool isMatched = ex.IsMatch("jjsss 中文 ksks");

沒有留言:
張貼留言