Вверх ↑
Ответов: 3349
Рейтинг: 233
#1: 2010-08-17 21:45:52 ЛС | профиль | цитата
Внимательнее msdn читать надо.
msdn писал(а):
Return Value

Returns TRUE if there is an active modem or a LAN Internet connection, or FALSE if there is no Internet connection, or if all possible Internet connections are not currently active. For more information, see the Remarks section.

Вот

Add(MainForm,7509938,112,224)
{
link(onCreate,11816952:ac,[])
}
Add(InlineCode,11816952,161,238)
{
WorkPoints=#2:ac|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|37:uses kol,Share,Debug,wininet,windows;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|43: procedure ac(var dt:TData; index:word);|5: end;|0:|14:implementation|0:|25:procedure THiAsmClass.ac;|28:var dwConnectionTypes:DWORD;|36:const INTERNET_CONNECTION_MODEM = 1;|36: INTERNET_CONNECTION_LAN = 2;|5:begin|1: |105: if InternetGetConnectedState(@dwConnectionTypes,0)then MsgBox('Соеденен',0) else MsgBox('НеСоеденен',0);|4:end;|0:|4:end.|
}

------------ Дoбавленo в 21.45:
Вот самый оптимальный способ

Add(MainForm,7509938,112,224)
{
link(onCreate,11816952:ac,[])
}
Add(InlineCode,11816952,182,238)
{
WorkPoints=#2:ac|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|37:uses kol,Share,Debug,wininet,windows;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|43: procedure ac(var dt:TData; index:word);|5: end;|0:|14:implementation|0:|25:procedure THiAsmClass.ac;|28:var dwConnectionTypes:DWORD;|41:const INTERNET_CONNECTION_CONFIGURED = 1;|34: INTERNET_CONNECTION_LAN = 2;|36: INTERNET_CONNECTION_MODEM = 3;|38: INTERNET_CONNECTION_OFFLINE = 4;|36: INTERNET_CONNECTION_PROXY = 5;|33: INTERNET_RAS_INSTALLED = 6;|5:begin|19:dwConnectionTypes:=|27:INTERNET_CONNECTION_MODEM +|25:INTERNET_CONNECTION_LAN +|26:INTERNET_CONNECTION_PROXY;|115:if InternetGetConnectedState(@dwConnectionTypes, 0) then _debug('Ты в интернете') else _debug('Ты не в интернете');|4:end;|0:|4:end.|
}

карма: 1

0