G gytyl Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-20 #1 小弟想通过delphi程序设置本地机器的IP,不知道该如何实现。
A andy263 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-20 #2 var Reg: TRegistry; begin Reg := TRegistry.Create; Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKey('/System/CurrentControlSet/Services/Class/NetTran s/0000', True) then Reg.WriteString('IPAddress','192.1.1.1'); Reg.CloseKey; Reg.Free; end; end;
var Reg: TRegistry; begin Reg := TRegistry.Create; Reg.RootKey := HKEY_LOCAL_MACHINE; if Reg.OpenKey('/System/CurrentControlSet/Services/Class/NetTran s/0000', True) then Reg.WriteString('IPAddress','192.1.1.1'); Reg.CloseKey; Reg.Free; end; end;
F Faczxy Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-21 #3 二楼说的方法要重新启动 如果不想重起,只有一种办法,那就是DOS命令,我以前做过,我查一下 好像是.netXXXX具体我忘了
A andy263 Unregistered / Unconfirmed GUEST, unregistred user! 2004-02-27 #5 shellexecute(handle,'','netsh interface ip set address 本地连接 static 192.168.0.1 255.255.255.0 192.168.0.10 1',nil,nil,sw_hide)
shellexecute(handle,'','netsh interface ip set address 本地连接 static 192.168.0.1 255.255.255.0 192.168.0.10 1',nil,nil,sw_hide)