Run .exe on client system from server-side c# code

前端 未结 4 629
我在风中等你
我在风中等你 2020-12-20 02:32

I want to run an exe on client system from my c# asp.net website. When I use Process.Start() it throws an error:

The requested operation

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-20 03:34

    I noticed you said you wanted to run an exe file on the client, but you didn't say explicitly that the exe is on the server and you want to push it to the client. Everyone seems to be assuming that is the case.

    You CAN accomplish this fairly easily with a small JavaScript if you have a few prerequisites:

    1. The executable is already present on the client machine.
    2. All of your clients are running IE
    3. You can enforce a policy to put your site in the Intranet or Trusted Sites zone.

    So basically this means it's a corporate intranet application. I am assuming this is probably the case since, well, if you were expecting to do this with a public app, I would be surprised.

    For the script to accomplish this, please see my answer to this question:

    How can I get a program on a client machine to run from an ASP.NET page?

提交回复
热议问题