View difference between Paste ID: LYjdKGfG and JN7p3KjF
SHOW: | | - or go back to the newest paste.
1
[Code]
2-
function DownloadFile(const AURL: string; var AResponse: string): Boolean;
2+
3
var
4-
  WinHttpRequest: Variant;
4+
5
  DeXVersion: string;
6
begin
7-
  try
7+
8-
    WinHttpRequest := CreateOleObject('WinHttp.WinHttpRequest.5.1');
8+
9-
    WinHttpRequest.Open('GET', AURL, False);
9+
10-
    WinHttpRequest.Send;
10+
11-
    AResponse := WinHttpRequest.ResponseText;
11+
12-
  except
12+
    // blah blah
13-
    Result := False;
13+
  end
14-
    AResponse := GetExceptionMessage;
14+
  else
15-
  end;
15+
    MsgBox('It seems you have no Internet connection...', mbInformation, MB_OK);
16-
end;
16+