在.Net 2.0中使用C#启用/禁用LAN连接 [英] To Enable/Disable LAN connection using C# in .Net 2.0

查看:70
本文介绍了在.Net 2.0中使用C#启用/禁用LAN连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想使用C#程序在系统中启用/禁用网络(LAN)连接.我将.Net 2.0用于开发和测试.我需要在此框架中执行此操作.
请给我建议如何做.
在此先感谢.
Mahe

Hi All,
I want to Enable/Disable the Network (LAN )connection in my system using C# programs.I am using .Net 2.0 for my development & I need to do this in this framework.
Please advice me how to do it.
Thanks in Advance.
Mahe

推荐答案

您可以运行类似于的内容通过命令提示符[^ ].
You could run something similar to this[^] via the command prompt.


希望使用netsh接口使用情况设置接口[name =] IfName [[admin =] ENABLED | DISABLED [connect =] CONNECTED | DISCONNECTED [newname =] NewName] 这将给出一个


浏览以下链接..,

http://www.pinvoke.net/default.aspx/advapi32.ControlService [ ^ ]
Go through the below link..,

http://www.pinvoke.net/default.aspx/advapi32.ControlService[^]


这篇关于在.Net 2.0中使用C#启用/禁用LAN连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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