How to call exe from asp.net website page?
-
Hi Friendz... I have a exe to be executed (Windows form to be opened) when user clicks on link button on asp.net page. I placed the exe on the server and given the path in web.config file. path is accessed in application from web.config file. I am using the following code to run the exe from asp.net: string path = for ex: "C:\X\pay.exe" Process.Start(path); This is working fine on my local machine. But after deploying the application on the server, it is not calling exe and not giving any exceptions/errors. I also placed the exe on the server. Please let me know if there is any way to get rid off this problem. Thank you, Raheem MA
-
Hi Friendz... I have a exe to be executed (Windows form to be opened) when user clicks on link button on asp.net page. I placed the exe on the server and given the path in web.config file. path is accessed in application from web.config file. I am using the following code to run the exe from asp.net: string path = for ex: "C:\X\pay.exe" Process.Start(path); This is working fine on my local machine. But after deploying the application on the server, it is not calling exe and not giving any exceptions/errors. I also placed the exe on the server. Please let me know if there is any way to get rid off this problem. Thank you, Raheem MA
It will try and run the exe on the server, 'cause it's server side code - not on the client...
-
Hi Friendz... I have a exe to be executed (Windows form to be opened) when user clicks on link button on asp.net page. I placed the exe on the server and given the path in web.config file. path is accessed in application from web.config file. I am using the following code to run the exe from asp.net: string path = for ex: "C:\X\pay.exe" Process.Start(path); This is working fine on my local machine. But after deploying the application on the server, it is not calling exe and not giving any exceptions/errors. I also placed the exe on the server. Please let me know if there is any way to get rid off this problem. Thank you, Raheem MA
You're fundamentally lacking knowledge of how ASP.NET runs. All code in your code behind is run on the server. While you're developing your machine is essentially the server so the exe will run on your machine. When deployed to a web server, the exe will open on the server (assuming it had permission, which it usually wont in a live environment). Your only option is to allow the user to download the exe, and let them decide to run it. You, after all, cannot expect to dictate to the user what they should run from a webpage - imagine the security implications.