Ask the Expert

How can I pass parameters to my .exe app from ASP.NET?

I have written a VB.NET console application that sends e-mails to users. I need to call this app from ASP.NET after a user clicks on submit. I called my .exe from ASP.NET directly, but there were no e-mails. I also tried to call the .exe through DLL, which is called by ASP.NET, but to no avail. I am not getting any error but no output.

One more thing: How can I pass parameters to my .exe app from ASP.NET?
There's built-in support for mail in ASP.NET. Take a look at the System.Web.Mail namespace. You can easily send mails from there. As for passing parameters to a .exe, you should use the ProcessStartInfo and Process classes in the System.Diagnostics namespace:

ProcessStartInfo i = new ProcessStartInfo("myexe.exe", "-arg1 -arg1 -others");
Process p = new Process();
p.StartInfo = i;

This was first published in June 2003

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: