To xuying():
SetIfEntry()函数需要的参数是一个结构类型的指针。
我想用GetIfEntry()函数先获得这个指针.
{这是MSDN中的说明
DWORD GetIfEntry(PMIB_IFROW pIfRow );
pIfRow :[in] Pointer to a MIB_IFROW structure that receives information for an interface on the local computer. Set the dwIndex member of MIB_IFROW to the index of the interface for which to retrieve information}
其中的pIfRow->dwIndex,如何得到。
To :gboy(hello)
同样感谢你的回复,不过这种方法,是增加一个IP地址,原来的那个还存在,怎么办。你有没有实现的源代码。
DWORD AddIPAddress(
IPAddr Address, // IP address to add
IPMask IpMask, // subnet mask for IP address
DWORD IfIndex, // index of adapter
PULONG NTEContext, // Net Table Entry context
PULONG NTEInstance // Net Table Entry Instance
);