delphi xe3里判断网络是否连接成功


本文整理自网络,侵删。

 delphi xe3里判断网络是否连接成功  

unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Web.Win.Sockets;

type
  TForm2 = class(TForm)
    TcpServer1TTcpServer;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormCreate(Sender: TObject);
begin
  try
   TcpServer1.Active :=True ;
   ShowMessage('网络已连接')
  except
    ShowMessage('网络没连接');
  end;
end;

end.

相关阅读 >>

Delphi 自我复制源码

Delphi 按esc快捷键退出程序的简单方法

Delphi rs232c串行通讯接口的应用

Delphi 把整个窗体保存为图片的方法

Delphi txt 指定行复制器

Delphi 加载大文件显示进度条

Delphi 获取ie7 ie8 ie9 地址栏网址

Delphi qr /条形码扫描仪应用示例代码(使用zxing,tframestand)

Delphi urunpe

Delphi 关于构造方法的重写

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...