如何在C ++窗口中重启网卡 [英] How to restart network card in C++ windows
本文介绍了如何在C ++窗口中重启网卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想以编程方式重新启动网络接口,因此它可以使用在注册表中定义的新mac地址。我怎么能这样做?
我尝试过:
I want to restart network interface programmatically, so it could use new mac address defined in registry. How can I do so?
What I have tried:
system("netsh interface set interface [name] disabled")
当然这是一个noob选项,我必须知道[name]。
Which is a noob option of course, and I have to know the [name].
推荐答案
I已经在Windows上撰写了关于网络API的小文章。 br />
以下是INetCfg 界面。
I have written a small article about networking API on Windows.
Here is a starting point of the Microsoft documenation of the INetCfg interface.
这篇关于如何在C ++窗口中重启网卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文