按钮单击时重启IIS的C#程序 [英] C# program for IIS restart on button click

查看:167
本文介绍了按钮单击时重启IIS的C#程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在asp.net 2.0中的C#编程按钮上重启IIS 6.0。我试图使用C#代码执行此操作。我已经看到一些关于通过代码重启IIS的类似问题。但我无法从中获得任何有效的解决方案。关于如何进行重启操作的一些明确的C#代码将非常有用。

解决方案

how-to-restart-iis-using-c / [ ^ ]


http://terrapinstation.wordpress.com/2008/06/12 / restart-iis-application-pool-from-aspnet-page /



查看此链接..


您可以尝试:

  //  使用.. 。 
使用 System.Diagnostics;

public class YourForm:Form
{
// ...

private void yourButton_Click( object sender,EventArgs e)
{
Process.Start( @ C:\ WINDOWS \ system32 \ iisreset.exe / noforce);
}

// ...
}


I need to restart IIS 6.0 on button click from C# programming in asp.net 2.0. I am trying to do this using C# code. I have seen some similar questions about restarting IIS through code. But I have not been able to get any working solution from it. Some clearcut C# code about how to do the restart operations would be really helpful.

解决方案

how-to-restart-iis-using-c/[^]


http://terrapinstation.wordpress.com/2008/06/12/restart-iis-application-pool-from-aspnet-page/

Check this Link..


You could try:

// using ...
using System.Diagnostics;

public class YourForm : Form
{
   // ...

   private void yourButton_Click(object sender, EventArgs e)
   {
      Process.Start(@"C:\WINDOWS\system32\iisreset.exe", "/noforce");
   }

   // ...
}


这篇关于按钮单击时重启IIS的C#程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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