1
我創建的自動連接到本地服務器,並下載更新程序,這裏是代碼:TIdHTTP異常處理
// Connect to web server and download ToBeInstalled.ini
Url := 'http://'+IPAdd+'/ToBeInstalled.ini';
MS := TMemoryStream.Create
try
try
http.Get(url, MS);
code := http.ResponseText;
except
on E: EIdHTTPProtocolException do
code := http.ResponseCode;
end;
MS.SaveToFile(UserPath + 'ToBeInstalled.ini');
finally
http.Free();
end;
程序工作得很好,而在辦公室,但是當用戶回家並不能達到服務器或服務器不可用的get「套接字錯誤#10061'
我不知道如何捕捉一個更壞的消息是,程序停止執行該誤碼M畢竟在一起顯示消息。你有什麼想法如何解決這個問題。非常感謝。
這做到了。非常感謝。 – Cor4Ever 2013-04-28 23:34:52
更多關於'TIdHTTP'異常的信息,請參閱['here'](http://stackoverflow.com/a/13954599/960757)。 [1] – TLama 2013-04-29 06:46:08