如何用delphi实现对网卡的禁用!(100分)

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

cloudmoon

Unregistered / Unconfirmed
GUEST, unregistred user!
在delphi中如何实现断开网络或者禁用网卡,各位大侠请帮忙!!!
 
用IphlpApi中的函数
Platform SDK: Internet Protocol Helper
SetIfEntry
Use the SetIfEntry function to set the administrative status of an interface.

DWORD SetIfEntry(
PMIB_IFROW pIfRow
);
Parameters
pIfRow
[in] Pointer to a MIB_IFROW structure. The dwIndex member of this structure specifies the interface on which to set administrative status. The dwAdminStatus member specifies the new administrative status. The dwAdminStatus member can be one of the following values.
Value Meaning
MIB_IF_ADMIN_STATUS_UP The interface is administratively enabled.
MIB_IF_ADMIN_STATUS_DOWN The interface is administratively disabled.
Return Values
If the function succeeds, the return value is NO_ERROR.
If the function fails, use FormatMessage to obtain the message string for the returned error.
Requirements
Windows NT/2000/XP: Included in Windows NT 4.0 SP4 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Iphlpapi.h.
Library: Use Iphlpapi.lib.
 
那里有这两个文件Iphlpapi.h ,Iphlpapi.lib?我的delphi下没有..
 
0738,你好,你能否告诉我具体怎么用吗?我试了一下,没成功啊,请给我代码,
可以吗,感激。pengmai2002@hotmail.com
 
ftp://delphi-jedi.org/api/IPHlpAPI.zip
里面包括几乎所有的网卡,ip,dns相关的代码和.h头文件的delphi译本,附有范例程序
 
顶部