![]() |
![]() ![]() ![]() |
WinHTTP component.
|
property OnHostUnrachable: TNotifyEvent;
|
The OnHostUnreachable event occurs if the WinHTTP can not connect to the remote host specified in the URL property. Possible reasons of this problem is:
|
1. | User currently not connected to the Internet;
|
2. | Hostname is unknown (check spelling of domain name);
|
3. | Remote server is down (disconnected from Internet).
|
1. | The OnHostUnreachable event occurs also when user currently working offline (even if connection to the Internet present) and would like to post some data, specified in the POSTData property, to the CGI program. Posting to the CGI programs requires active Internet connection.
|
procedure TForm1.WinHTTP1HostUnreachable(Sender: TObject);
|
begin
|
Application.MessageBox(PChar('Host http://' + WinHTTP1.HostName + ' is unreachable.'#13'Please check your Internet connection and'#13'retry your HTTP request again later.'),
|
PChar(Application.Title),
|
MB_OK or MB_ICONSTOP);
|
end;
|
|
void __fastcall TForm1::WinHTTP1HostUnreachable(TObject *Sender)
|
{
|
AnsiString Msg =
|
"Host http://" + WinHTTP1->HostName + " is unreachable.\n\n"
|
"Please check your Internet connection and\n"
|
"try to upgrade this software again later.";
|
Application->MessageBox(Msg.c_str(),
|
Application->Title.c_str(),
|
MB_OK | MB_ICONSTOP);
|
}
|
URL property; OnAnyError event.
|