Ads 468x60px

Smaller time frame always follow the bigger time frame. It's better wait be patience to enter in position than risk with BIG SL. Having strong trading discipline and taking losses when necessary is a sign of serious trading approach

Saturday, June 23, 2012

Check Whether Connected or no to Internet?


Connected to Internet?

Sometimes you need to know if the computer on which your program is running has 
Internet connection in order to check for updates connect to a server and serve asslave :) 

Add "WinInet" to uses clause.


function ConnectedToNet: boolean;
var
  flags: DWORD;
begin
  Flags :=
    INTERNET_CONNECTION_MODEM or
    INTERNET_CONNECTION_LAN or
    INTERNET_CONNECTION_PROXY or
    INTERNET_CONNECTION_MODEM_BUSY;
  result := InternetGetConnectedState(@Flags, 0);
end;

Usage
 ShowMessage(BoolToStr(ConnectedToNet, True));


source



 comments