Delphi 7中 TIdUDPServer 的接收端怎么写代码?
叽哥飞 2014-12-15 05:02:47 我在发送端写下这样的代码
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdUDPServer, IdBaseComponent, IdComponent, IdUDPBase,
IdUDPClient, StdCtrls;
type
TForm1 = class(TForm)
IdUDPServer1: TIdUDPServer;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure IdUDPServer1Status(ASender: TObject;
const AStatus: TIdStatus; const AStatusText: String);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
IdUDPServer1.Send('10.95.162.165',2000,'123456');
end;
procedure TForm1.IdUDPServer1Status(ASender: TObject;
const AStatus: TIdStatus; const AStatusText: String);
begin
showmessage('received');
end;
end.
那接收端就应该怎样接收了?