0
Visual studio should run as Administrator:
Posted on 8:56 AM by Softminer and filed under
C#
Visual studio should run as Administrator:
Process cmd = new Process(); ProcessStartInfo info = new ProcessStartInfo(@"cmd.exe", ""); info.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; info.WorkingDirectory = @"c:\"; info.RedirectStandardInput = true; info.RedirectStandardOutput = true; info.RedirectStandardError = true; info.UseShellExecute = false; info.CreateNoWindow = true; cmd.StartInfo = info; cmd.Start(); cmd.StandardInput.WriteLine(@"c:\Windows\system32\inetsrv\appcmd recycle apppool /apppool.name:DefaultAppPool"); cmd.StandardInput.Flush(); cmd.StandardInput.Close(); string output = cmd.StandardOutput.ReadToEnd();
Post a Comment