那就用delphi来实现ipconfig功能啊
下面试我的一段程序,你试一试
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,shellapi,
StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
temp:string;
implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);begin
memo1.Lines.Clear ;
if fileexists(temp) then
deletefile(temp);
winexec(pchar('command.com /C ipconfig>'+temp),sw_hide);
while not fileexists(temp) do
sleep(1000);try
memo1.lines.loadfromfile(temp);
except
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.lines.clear;
temp:='c:\temp.txt';
end;
end.
下面试我的一段程序,你试一试
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,shellapi,
StdCtrls;type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
temp:string;
implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);begin
memo1.Lines.Clear ;
if fileexists(temp) then
deletefile(temp);
winexec(pchar('command.com /C ipconfig>'+temp),sw_hide);
while not fileexists(temp) do
sleep(1000);try
memo1.lines.loadfromfile(temp);
except
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.lines.clear;
temp:='c:\temp.txt';
end;
end.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货