今天在GoDaddy的空間測試asp無組件上傳的功能,結果發現運行不了,一開始還以為是權限設置問題,但是到后臺檢查后,確認已經開啟可寫權限了。
根據報錯信息
Invalid procedure call or argument: 'Chr'
我在網上搜了下,結果發現是因為由于英文操作系統引起的問題,呵呵~這個倒沒有想到,估計一貫用國內空間的朋友也不會遇到過這個問題。
解決辦法是找到stemp=stemp&Chr(AscW(ChrB(AscB(upfile_5xSoft_Stream.Read(1)))&ChrB(c))) 替換成stemp=stemp&Chrw(AscW(ChrB(AscB(upfile_5xSoft_Stream.Read(1)))&ChrB(c))),問題就解決了。
參考資料:
Chr 、ChrW 函數
返回與指定字符代碼相關聯的字符。
Public Function Chr(ByVal CharCode As Integer) As Char
Public Function ChrW(ByVal CharCode As Integer) As Char
參數
- CharCode
必選。Integer 表達式,表示字符的“碼位”或字符碼。如果 CharCode 不在有效范圍之內,將發生錯誤。Chr 的有效范圍是 0 到 255,而 ChrW 的有效范圍是 -32768 到 65535。
更多請參考:Microsoft MSDN
x

