不知道 llhh的问题搞定没有? 贴在下面了:Question/Problem/Abstract: 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;
Function HasInternetconnect:boolean; var REG:TRegistry; dat:array[0..3] of char; begin reg:=TRegistry.Create; reg.RootKey:=HKEY_LOCAL_MACHINE; reg.OpenKey('System\CurrentControlSet\Services\RemoteAccess',false); reg.ReadBinaryData('Remote Connection',dat,4); reg.free; result:=(dat[0]=#1); end; if HasInternetconnect then showmessage('connect') else showmessage('disconnect');
贴在下面了:Question/Problem/Abstract:
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;
Function HasInternetconnect:boolean;
var REG:TRegistry;
dat:array[0..3] of char;
begin
reg:=TRegistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey('System\CurrentControlSet\Services\RemoteAccess',false);
reg.ReadBinaryData('Remote Connection',dat,4);
reg.free;
result:=(dat[0]=#1);
end;
if HasInternetconnect
then showmessage('connect')
else showmessage('disconnect');