uses IdIPWatch; function GetNativeIP: String; var IdIPWatch: TIdIPWatch; begin IdIPWatch := TIdIPWatch.Create(nil); try Result := IdIPWatch.LocalIP; finally IdIPWatch.Free; end; end;
DelphiXE7下编写。
uses IdIPWatch; function GetNativeIP: String; var IdIPWatch: TIdIPWatch; begin IdIPWatch := TIdIPWatch.Create(nil); try Result := IdIPWatch.LocalIP; finally IdIPWatch.Free; end; end;
DelphiXE7下编写。