Главная страница | назад





Article #17763: Is my machine connected to the network.

 Question and Answer Database
FAQ2763D.txt Is my machine connected to the network.
Category :Windows API
Platform :All
Product :All 32 bit
Question:
How can my application tell if the machine is connected to a
network under Windows 95?
Answer:
You can call the Windows API function GetSystemMetrics() and pass
the SM_NETWORK flag.
Example:
procedure TForm1.Button1Click(Sender: TObject);
begin
if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then
ShowMessage('Machine is attached to network') else
ShowMessage('Machine is not attached to network');
end;
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99