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)
    TcpServer1: TTcpServer;
    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.

相关阅读 >>

快速查询posex与posrightex

Delphi 系统appdata local 路径

Delphi xe下支持unicode编码方式

Delphi memo1 高亮行的范围

Delphi 查找字符串并删除该字符串

Delphi opendialog文件多选

Delphi 动态添加资源文件

Delphi leftstr 返回字符串左边指定个数的新字符(串)

Delphi stringgrid常用属性和常用操作

Delphi10 一段汇编程序

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



打赏

取消

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

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

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

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

评论

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