[問題] 關於WebClient UploadFile (WindowsForm)

看板C_Sharp (C#)作者 (哇哈哈)時間13年前 (2012/07/26 15:55), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
小弟我是使用Windows Form C++ 語法。在使用WebClient 的FileUpload功能時出現 類型 'System.Net.WebException' 的未處理例外狀況發生於 System.dll 其他資訊: 遠端伺服器傳回一個錯誤: (417) Expectation Failed。 上網Google過,網上寫說只要多加一行 ServicePointManager.Expect100Continue = false 即可解決,但是我加了以後還是有同樣的問題,想請問還有什麼方法可以解決這樣 的情況嗎? [ Part Source Code ] ServicePointManager::Expect100Continue = false; WebClient^ MywebClient = gcnew WebClient; String^ URL = "網址"; String^ FilePath = "檔案路徑"; if ( !File::Exists( FilePath ) ) { showlog("IPK does not exist !"); return Fail; } array<Byte>^responseArray = MywebClient->UploadFile( URL , FilePath ); 我的檔案大小只有2KB,想請問有可能是檔案類型有限制嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.61.29.25
文章代碼(AID): #1G4FVxNF (C_Sharp)
文章代碼(AID): #1G4FVxNF (C_Sharp)