谁可以给一个GetIP和GetDomainName的例子呀。(5分)

  • 主题发起人 主题发起人 China_Wolf
  • 开始时间 开始时间
C

China_Wolf

Unregistered / Unconfirmed
GUEST, unregistred user!
靠,分太少了
 
晕晕,俺可是穷人咯。分不够再加20?
 
如果是获得本机的,Delphi 7下,加入IdIPWatch:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdIPWatch, StdCtrls;

type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
IdIPWatch1: TIdIPWatch;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Lines.Add(IdIPWatch1.LocalIP);
Memo1.Lines.Add(IdIPWatch1.LocalName);
end;

end.
 
接受答案了.
 
后退
顶部