getinternetlocalip.pas

来自「获取内存的信息的代码」· PAS 代码 · 共 47 行

PAS
47
字号
unit GetInternetLocalIP;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, HTTPGet;

type
  TGetInternetLocalIPForm = class(TForm)
    HTTPGet1: THTTPGet;
    procedure FormCreate(Sender: TObject);
    procedure HTTPGet1DoneString(Sender: TObject; Result: string);
    procedure HTTPGet1Error(Sender: TObject);
  private
    { Private declarations }
  public
    TheInternetLocalIP: string;
  end;

var
  GetInternetLocalIPForm: TGetInternetLocalIPForm;

implementation

{$R *.dfm}

procedure TGetInternetLocalIPForm.FormCreate(Sender: TObject);
begin
  TheInternetLocalIP := 'E';
  HTTPGet1.URL := 'http://www.neworigin.com.cn/GetNetIP';
  HTTPGet1.GetString;
end;

procedure TGetInternetLocalIPForm.HTTPGet1DoneString(Sender: TObject; Result: string);
begin
  TheInternetLocalIP := Result;
end;

procedure TGetInternetLocalIPForm.HTTPGet1Error(Sender: TObject);
begin
  TheInternetLocalIP := '';
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?