Como saber se está conectado na internet pelo delphi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| uses
WinInet;
function IsNetConected: Boolean;
const
FSiteList: array of PWideChar = [
'http://www.google.com/',
'http://www.microsoft.com/',
'http://www.yahoo.com/'
];
var
I: Byte;
begin
Result := False;
for I := 0 to Pred(Length(FSiteList)) do
begin
Result := InternetCheckConnection(FSiteList[I], 1, 0);
if Result then
Break;
end;
end; |
uses
WinInet;
function IsNetConected: Boolean;
const
FSiteList: array of PWideChar = [
'http://www.google.com/',
'http://www.microsoft.com/',
'http://www.yahoo.com/'
];
var
I: Byte;
begin
Result := False;
for I := 0 to Pred(Length(FSiteList)) do
begin
Result := InternetCheckConnection(FSiteList[I], 1, 0);
if Result then
Break;
end;
end;
Post Views: 4.623
-
Ivan Cesar
-
- 0 comentários
- 18 de julho de 2016