停止IIS服务
ServiceController sc = new ServiceController("iisadmin");
if(sc.Status==ServiceControllerStatus.Running)

{

sc.Stop();
}

重启IIS服务
ServiceController sc = new ServiceController("iisadmin");
 sc.Start();

重启进程
using System.Diagnostics;
Process.Start("iisreset");

转自:http://blog.csdn.net/educast/article/details/6227541

最新文章

  1. 【干货分享】前端面试知识点锦集04(Others篇)——附答案
  2. Git-it字典翻译
  3. JS中检测数据类型的四种方式及每个方式的优缺点
  4. vsftp 定时任务同步
  5. HDU----(2157)How many ways??(快速矩阵幂)
  6. unity, 查看.anim中的动画曲线(和帧)
  7. silverlight 报 System.NullReferenceException 未将对象引用设置到对象的实例。
  8. php学习笔记2--安装apache遇到的问题
  9. EL函数
  10. linux服务器git pull/push时提示输入账号密码之免除设置
  11. css画小米、遨游logo
  12. [五]类加载机制双亲委派机制 底层代码实现原理 源码分析 java类加载双亲委派机制是如何实现的
  13. mac 常用技巧
  14. Kibana简单使用教程
  15. 游戏中Row所指代的是什么?
  16. HTML基础【3】:列表标签
  17. Java容器解析系列(4) ArrayList Vector Stack 详解
  18. Ubuntu (虚拟机同样) 更换内核?
  19. English trip V1 - B 14. There Are Flowers in My Office 我办公室里有花 Teacher:Lamb Key: There be(is/are)
  20. indeed招聘

热门文章

  1. There is a chart instance already initialized on the dom!警告
  2. 关于java多线程中异常捕获的理解
  3. 关于在最新的 Visual Studio 2017 版本中使用 Web Deploy 遇到的 SSL 连接错误
  4. Nios II 程序固化(如何下载elf文件)
  5. Cocos 编译android-studio
  6. Redis 的事务到底是不是原子性的
  7. PON
  8. Python3 File
  9. IDEA自动生成序列化ID
  10. Cookiecutter: 更好的项目模板工具:(1)简介及可用资源汇总