AddIpAddress()函数错误 [英] AddIpAddress() function error

查看:151
本文介绍了AddIpAddress()函数错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

DWORD AddIPAddress(
__in IPAddr地址,
__在IPMask IpMask中,
__in DWORD IfIndex,
__out PULONG NTEContext,
__out PULONG NTEInstance
);


所有这些都是该功能的参数,但是我该如何定义我想更改我的wifi适配器而不是以太网的ip的第三个参数.
我应该给我什么身份才能更改我的wifi ip地址...

在此先谢谢您..

DWORD AddIPAddress(
__in IPAddr Address,
__in IPMask IpMask,
__in DWORD IfIndex,
__out PULONG NTEContext,
__out PULONG NTEInstance
);


this all are the parameter for this function but how can i define the 3rd argument that i want to change the ip of my wifi adapter not the ethernet.
what identity should i give to change my wifi ip address...

Thanks in advance..

推荐答案

首先,您是否知道根据msdn [ GetIpAddrTable()获取其索引. a> [ ^ ].相反,如果您知道适配器的名称,友好名称"或MAC,则可以使用
First, are you aware that according to msdn[^]: The IPv4 address added by the AddIPAddress function is not persistent. Is this suitable for your needs?

Now you need the index of the IPv4 interface of the adapter you want to deal with. If you know its existing IP address, you could get its index from GetIpAddrTable()[^]. If, instead, you know the adapter''s name, "friendly name", or MAC, you can determine the index by using GetAdaptersAddresses()[^].

You will find more information and some sample code at the links to Msdn.


这篇关于AddIpAddress()函数错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆