How can I create a process that is running a supplied native executable (e.g., cmd.exe)?
Submitted by: AdministratorThe following code should run the executable and wait for it to exit before
continuing: using System;
using System.Diagnostics;
public class ProcessTest {
public static void Main(string[] args) {
Process p = Process.Start(args[0]);
p.WaitForExit();
Console.WriteLine(args[0] + " exited.");
}
}
Remember to add a reference to System.Diagnostics.dll when you compile.
Submitted by: Administrator
continuing: using System;
using System.Diagnostics;
public class ProcessTest {
public static void Main(string[] args) {
Process p = Process.Start(args[0]);
p.WaitForExit();
Console.WriteLine(args[0] + " exited.");
}
}
Remember to add a reference to System.Diagnostics.dll when you compile.
Submitted by: Administrator
Read Online C# (Sharp) Programming Language Job Interview Questions And Answers
Top C# (Sharp) Programming Language Questions
☺ | What is a delegate in C#? |
☺ | What is the difference between const and static read-only? |
☺ | Why would you use untrusted verification? |
☺ | Which control cannot be placed in MDI? |
☺ | What does the parameter Initial Catalog define inside Connection String? |
Top Dot Net Technologies Categories
☺ | MSF Interview Questions. |
☺ | .Net Architecture Interview Questions. |
☺ | ASP.Net MVC Interview Questions. |
☺ | Entity Framework Interview Questions. |
☺ | C# (Sharp) Programming Language Interview Questions. |