me下如何判断某块网卡的DHCP是否enabled?

Amacro 2002-11-05 09:38:42
我用delphi编写的程序中调用iphlpapi.dll中的GetAdaptersInfo()读adpterInfo,但是在me下该函数出现问题,得到的adpterInfo信息不全,仅有网卡IP和MAC,而dhcp的enabled,IP,MAC值不能正常得到(为空)。我试了几次都是同样的结果,我想可能是GetAdaptersInfo在me 下的bug。
  不知还有其它办法能知道me下如何判断某块网卡的DHCP是否enabled吗?
...全文
133 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Amacro 2002-11-05
  • 打赏
  • 举报
回复
这个办法好象有点不是很正规啊,而且这样做效率极受影响。我试一下,看效果如何?不知能有更好一点的办法吗(如读注册表信息等)?
  不过还是很感谢你的回复!
naughtyboy 2002-11-05
  • 打赏
  • 举报
回复
dos下面有这样的命令
ipconfig/all
winexec(pchar('command.com /c ipconfig/all>temp.txt'),sw_hide);
c:\temp.txt里面有DHCP信息

uses shellapi;
var
temp:string;
begin
temp:='c:\temp.txt';
if fileexists(temp) then
deletefile(temp);
winexec(pchar('command.com /c ipconfig/all>temp.txt'),sw_hide);
while not fileexists(temp) then
sleep(3000);
memo1.clear;
memo1.lines.loadfromfile(temp);


end;

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧