瑞文文摘
返回首页 | 手机用户请点此访问手机版
关键字:delphi自定义函数[过程],获取本机IP地址和主机名 | 时间:2012/9/23

【delphi源码】获取本机IP地址和主机名

unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Sockets, ExtCtrls;
type
TForm1 = class(TForm)
UdpSocket1: TUdpSocket;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
self.Caption:=self.UdpSocket1.LocalHostName;
self.Caption:=self.Caption+':'+self.UdpSocket1.LocalHostAddr;
end;
end.




上一篇:【主题队会】《感恩母亲》主题中队会

下一篇:【delphi源码】启动一个新的IE并控制其运行

Copyright © 瑞文软件工作室 冀ICP备17033643号 联系我们