Veeresh Kumar

Veeresh Kumar

  • NA
  • 51
  • 14k

How to run iis express from winforms app

Feb 13 2019 6:36 AM
My code is that.
 
 
public void ExecuteCommandSync(object command)
{
try
{
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd", "ipconfig " + command);
procStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
//procStartInfo.Arguments = @" C:\Users\star";
procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = false;
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
string result = proc.StandardOutput.ReadToEnd();
proc.WaitForExit();
Console.WriteLine(result);
}
catch (Exception objException)
{
}
}
 
I can not run cmd prompt from that code this is showing only project directory but i don't want that. 
 

Answers (3)