tags:

views:

413

answers:

2

Is it possible to restart IIS7 using C#? If so, how?

+1  A: 

Just execute the command-line option using System.Diagnostics.Process.Start();

Henri
+4  A: 
System.Diagnostics.Process.Start(@"C:\windows\system32\iisreset.exe");

should do the trick :)

Dan

Daniel Elliott
Probably should use environment variable for windows path though :)
Daniel Elliott