当前位置:首页 > 软件开发 > net
firefox

远程控制篇:获得网络邻居所有机器名

远程控制篇:获得网络邻居所有机器名

procedure tform1.button1click(sender: tobject);
var
    command:string ;
    comline: pchar  ;
begin
 command:=command.com /c net view>c:~~~.txt;
 comline:=pchar(command);
 winexec(comline, sw_hide);
 timer1.enabled:=true;
end;

每秒试一次
procedure tform1.timer1timer(sender: tobject);
var f:tstringlist;
    ll,ii:integer;
    s1,s:string;
    b:bool;
begin
f:=tstringlist.create;
try
  f.loadfromfile(c:~~~.txt);
 except
end;
if  f.count>10 then begin
memo1.clear;
memo1.lines.add(f.text);
timer1.enabled:=false;
f.free;
{去掉多余的行和\}
  for ll:=memo1.lines.count-1 downto 0 do begin
     if strpos(pchar(memo1.lines.strings[ll]),\)=nil then
       memo1.lines.delete(ll)
     else
       memo1.lines.strings[ll]:=delxxx(memo1.lines.strings[ll]);
        {自编1个去\的函数}
  end;
timer1.enabled:=false;
end;

--------------------------------------------
湖北襄樊  官本和(gbh12345@china.com)  2001.4
详见主页源程序:
http://delphi21cn.yeah.net
http://personal.hb.cninfo.net/~gbh

 ↓相关文章:
© 2006-2008 All Rights Reserved