Easy simple code behind

Hi, 

Can you help me please ?

I would like to know how can I launch a program.exe from my aspx page as I write "paint" in my command prompt window ?

Regards,

EM



August 28th, 2015 10:09am

Hi,

The following code snippet for your reference:

// Create a Process Object here. 

System.Diagnostics.Process process1 = new System.Diagnostics.Process();

//Working Directory Of .exe File. 

process1.StartInfo.WorkingDirectory = Request.MapPath("~/");

//exe File Name. 

process1.StartInfo.FileName = Request.MapPath("program.exe");

//Argement Which you have tp pass. 

process1.StartInfo.Arguments = " ";

process1.StartInfo.LoadUserProfile = true;

 //Process Start on exe.

process1.Start(); 

process1.WaitForExit(); 

process1.Close();

Refer to: How to run .EXE on button click in Asp.net(C#)

More information:

http://www.codedigest.com/Articles/ASPNET/334_Working_with_exe_in_ASPNet-Calling_KillingAborting_an_exe.aspx

http://www.codeproject.com/Tips/539195/Run-exe-inside-ASP-NET-and-catch-exception-using-A

As this question is more relate to ASP.NET, I suggest you post it to ASP.NET Forum, you will get more help and confirmed answers from there.

http://forums.asp.net/

Best Regards,

Dennis

Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2015 9:47pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics