unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Winsock, StrUtils;
type
TForm1 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
GroupBox1: TGroupBox;
Button1: TButton;
GroupBox2: TGroupBox;
ListBox1: TListBox;
StatusBar1: TStatusBar;
GroupBox3: TGroupBox;
Button2: TButton;
GroupBox4: TGroupBox;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
function LocalIP():string;
function GetIPHead(theIP: String ):String;
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//将IP写入控件
procedure TForm1.Button1Click(Sender: TObject);
var
theIP : String;
thePo : Integer;
begin
theIP := LocalIP();
theP
在Delhpi中得到本地IP地址,并计算出本网段的所有IP地址(可用于广播)
最新推荐文章于 2024-12-04 13:36:23 发布