Reputation: 65
I have a webpage
in ASP.NET
.
And I have an .exe
application which created using C#
.
First, the user have to download the .exe
application and should copy it to the C:\
.
That I can give the instruction in the webpage.
Using a link
in the webpage, I need to open that particular .exe
application.
I tried the following Code:
using System.Diagnostics;
......
......
......
ProcessStartInfo info = new ProcessStartInfo(@"C:\app.exe");
Process.Start(info);
This working fine locally, but when I uploaded it in the webserver
, I got the following Exception
.
Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
Then I searched in Google
and found how the iTunes
launches from the website.
Like from the following link.
Launches iTunes.exe from here
Then I tried to open the iTunes using the following link
.
<a href="itunes:///">Open iTunes</a>
It worked perfectly, but I tried the same with my .exe
application, it didn't open and at the same time it showed the following error.
HTTP Error 400 - Bad Request.
So can anyone guide me to open my .exe
application from my webpage
.
And if the .exe
is there in Bin
folder on server
, then how can I go about it.
Thanks
Upvotes: 0
Views: 413
Reputation: 6814
This
ProcessStartInfo info = new ProcessStartInfo(@"C:\app.exe");
Process.Start(info);
starts a new service on the server not on the client computer. You get an error message because there is no "C:\app.exe" on your server.
You cannot launch an application on local computer from asp.net server application.
Itunes is using a "protocol handler", read How does the Apple iTunes web site launch the iTunes application on my computer when I click the blue "Launch iTunes" button?
Upvotes: 3