Reputation: 1568
I have a website in asp.net with VB, and I have a link to a medical program that is installed in PC, when I click the link I want to execute the .exe for this program. I found this code but it´s works only when my project is locally:
System.Diagnostics.Process.Start("C:\Windows\System32\MiProgram.exe")
I also tried with this code:
Dim OpenDoc As ProcessStartInfo = New ProcessStartInfo
Dim stPath As String = "C:\Windows\System32\MiProgram.exe"
OpenDoc.FileName = stPath
OpenDoc.Verb = "open"
OpenDoc.WindowStyle = ProcessWindowStyle.Normal
Process.Start(OpenDoc)
Both codes works locally, but when I get my project to the web, does nothing
I also read that I can enable de IIS Service, I follow the steps of this page, but is not use to me.
Is there any solution to this problem?
I accept suggestions. Thanks.
Upvotes: 0
Views: 4651
Reputation: 809
You can do this with a work around..
You create a running Windows Forms application, on that application you host a wcf services, check this link as sample.
Expose a method like `RunApplication' put the same code their, where you can call it from your website, this will 100% work.
Upvotes: 1
Reputation: 912
You can try by implementing this settings:
In IIS 7/8 go Control Panel / Program And Features / Turn Windows features on or off, and check all items from: Web Managment Tools, (it's include: IIS Managment Service, II 6 Managment Compatibility)
Upvotes: 0
Reputation: 144
Unfortunately, it is not possible to run a program on the client from server-side. There is already some discussions about that, here is some links :
How to execute an application on the client from a website?
Run an exe in client machine from a website
Executing exe on client side using C#
Upvotes: 1