C# 启用 禁用 本地连接

 1         static void Enable(string interfaceName)
2 {
3 System.Diagnostics.ProcessStartInfo psi =
4 new System.Diagnostics.ProcessStartInfo("netsh", "interface set interface \"" + interfaceName + "\" enable");
5 System.Diagnostics.Process p = new System.Diagnostics.Process();
6 p.StartInfo = psi;
7 p.Start();
8 }
9
10 static void Disable(string interfaceName)
11 {
12 System.Diagnostics.ProcessStartInfo psi =
13 new System.Diagnostics.ProcessStartInfo("netsh", "interface set interface \"" + interfaceName + "\" disable");
14 System.Diagnostics.Process p = new System.Diagnostics.Process();
15 p.StartInfo = psi;
16 p.Start();
17 }
18 static List<Task> list = new List<Task>();
19 public static void Main(string[] str)
20 {
21 Disable("本地连接");
22 Console.ReadKey();
23 Enable("本地连接");
24 }

C# 启用禁用本地连接

C# snaps的更多相关文章

  1. saving snaps iteratively with for loop in Paraview

    Goal: read data 1 and slice, then save pressure, velocity contours, close data, then do loop for the ...

  2. zookeeper源码分析之一服务端启动过程

    zookeeper简介 zookeeper是为分布式应用提供分布式协作服务的开源软件.它提供了一组简单的原子操作,分布式应用可以基于这些原子操作来实现更高层次的同步服务,配置维护,组管理和命名.zoo ...

  3. win7 安装好redis 如何安装扩展

    首先我的电脑环境是使用的是wamp集成开发环境,PHP版本5.5.12的 安装要找对应的扩展,不然会出问题 php_redis.dll下载地址:http://windows.php.net/downl ...

  4. php中redis的安装

    1.当你在使用php时出现下面的问题 2.通过phpinfo()查看php的版本 我的是php5.6版本 3.查看需要下载的redis的版本 4.点击下面的额链接下载redis:http://wind ...

  5. Redis在windows环境下ThinkPHP的安装和使用

    1.Redis概述: 2.Redis在windows环境下的安装: 下载地址:https://github.com/dmajkic/redis/downloads,选取其中一个zip压缩包:

  6. ORACLE等待事件: log file parallel write

    log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...

  7. PHPExcel中文开发手册翻译版(2)

    2016年8月18日12:45:14 请注意这个是粗翻译版,仅供参考,不是精校版 精校版后面才会更新 PHPExcel开发者文档 1.目录 2. 4先决条件 2.1.软件要求4 2.2.安装说明4 2 ...

  8. windows 下安装redis并且测试(php)

    Window 下安装 下载地址:https://github.com/dmajkic/redis/downloads. 下载到的Redis支持32bit和64bit.根据自己实际情况选择,将64bit ...

  9. windows下安装php5.5的redis扩展

    windows下开发用的xampp集成的环境,想装个php-redis扩展,扩展的github地址:  https://github.com/nicolasff/phpredis php_redis. ...

  10. php redis 安装篇(windows 7)

    人人都说redis比memcached好,但是没有实际体验过,概念还是比较模糊,今天就先把redis安装好,后面的体验再分享,由于php已经有了很好的扩展库支持,所以redis安装非常方便,下面是wi ...

随机推荐

  1. url 获取 值

    https://blog.csdn.net/weixin_50878675/article/details/126348725

  2. 安装完IDEA后无法打开

    安装完IDEA后无法打开 一.现象 安装完IDEA2021.3版本后,无论用什么办法都无法打开 二.原因 原先有安装过idea,里面有加载过一些插件,或者是破解过,会生成一些文件,导致IDEA无法运行 ...

  3. java链接pg数据库remaining connection slots are reserved for non-replication superuser connections问题

    最近遇到链接pg数据库报错:remaining connection slots are reserved for non-replication superuser connections.百度说, ...

  4. python 非阻塞线程对话框,非qt(解决qt MessageBox使用线程时候卡死问题)

    def msg_okbox(self, strinfo, isYesno=False): if isYesno: return win32api.MessageBox(None, strinfo, & ...

  5. cookie,session,token,drf-jwt

    1.cookie,session,token发展史 引入:我们都知道 http 协议本身是一种无状态的协议,一个普通的http请求简单分为三步:客户端发送请求request服务端收到请求并进行处理服务 ...

  6. C++数组(一):一维数组

    C++一维数组 C++数组的定义方式 数据类型 数组名[数组长度]; 例子:int arr[3]; arr[0] = 1; arr[1] = 2; arr[2] = 3; 数据类型 数组名[数组长度] ...

  7. App自动化中 - 三大元素定位工具

    文章转自:https://blog.csdn.net/lkm564513278/article/details/105511411 在日常android app自动化测试工作当中,使用一种工具可能难以 ...

  8. Kubernetes 安装网络插件(calico)

    简介 Calico是Kubernetes生态系统中另一种流行的网络选择.虽然Flannel被公认为是最简单的选择,但Calico以其性能.灵活性而闻名.Calico的功能更为全面,不仅提供主机和pod ...

  9. Java并发编程 —— synchronized关键字

    一.是什么?(作用) synchronized关键字解决了多个线程之间访问资源的同步性问题,保证了被其修饰的方法或是代码块在任意时刻只能有一个线程执行. 而在早期的Java版本中,synchroniz ...

  10. 解决Mac安装Homebrew失败

    首先使用Homebrew官网的安装shell命令安装: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebr ...