展开全部
uses添加wininet;
procedure TForm1.Button1Click(Sender: TObject);
var
Types:integer;
begin
Types:=INTERNET_CONNECTION_MODEM+INTERNET_CONNECTION_LAN+INTERNET_CONNECTION_PROXY;
if internetGetConnectedState(@types,0) then
edit1.text:='已经连接'
else
edit1.text:='没有连接';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Types:integer;
begin
Types:=INTERNET_CONNECTION_MODEM+INTERNET_CONNECTION_LAN+INTERNET_CONNECTION_PROXY;
if internetGetConnectedState(@types,0) then
edit1.text:='已经连接'
else
edit1.text:='没有连接';
end;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets;
type
TForm1 = class(TForm)
TcpServer1: TTcpServer;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
try
TcpServer1.Active :=True ;
ShowMessage('网络已连接')
except
ShowMessage('网络没连接');
end;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets;
type
TForm1 = class(TForm)
TcpServer1: TTcpServer;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
try
TcpServer1.Active :=True ;
ShowMessage('网络已连接')
except
ShowMessage('网络没连接');
end;
end;
end.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询