2011-09-28 58 views
0
public static void RestartIIS() 
{ 
    string path = Environment.GetFolderPath(Environment.SpecialFolder.System) + @"\iisreset.exe"; 
    System.Diagnostics.ProcessStartInfo info = new System.Diagnostics.ProcessStartInfo(path); 
    info.UseShellExecute = true; 
    System.Diagnostics.Process.Start(info); 
} 
+1

你的问题是什么? – Justin

+0

你是否需要重新启动IIS或只是该网站?做后者的一个肮脏的方法是简单地写一个文件到网站。 –

+0

它不工作..有没有解决方案? – husseinzx

回答