AdsGetLocalAddress
Delphi 5 Programm
unit frmAdsGetLocalAddressUnit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, TcAdsDef, TcAdsApi, Buttons ;
type
TfrmAdsGetLocalAddress = class(TForm)
Label1: TLabel;
BitBtn1: TBitBtn;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
addr : TAmsAddr;
end;
implementation
{$R *.DFM}
/////////////////////////////////////////////////////////////////////////
procedure TfrmAdsGetLocalAddress.FormCreate(Sender: TObject);
var result : Longint;
begin
result := AdsGetLocalAddress( @addr );
Label1.Caption := Format( 'Result: %d, AmsNetId: %d.%d.%d.%d.%d.%d, AmsPort: %d [0x%x]',[
result,addr.netid.b[0],addr.netid.b[1],addr.netid.b[2],
addr.netid.b[3],addr.netid.b[4],addr.netid.b[5],
addr.port, addr.port] );
end;
end.
Dokumente hierzu