简体   繁体   English

从aspx.cs在客户端运行Windows应用程序

[英]run windows application at client side from aspx.cs

I have windows application in c#.that is installed for client . 我在为client安装的c#。中有Windows应用程序。 I need run that window application from client side when user button click in asp.net web application 当用户按钮在asp.net Web应用程序中单击时,我需要从客户端运行该窗口应用程序

Explanation 说明

I have task that scan hard copy from scanner . 我有从扫描仪扫描纸质副本的任务。 I developed web application in asp.net c#. 我在asp.net c#中开发了Web应用程序。 I have search in Google to do this so many peoples are saying that is not possible due to permissions. 我已经在Google中进行搜索,因此很多人都说由于权限原因这是不可能的。 so I developed windows application when I run that window application(c#) it scan the hard copy from scanner this window application run in background so I need to run this window application. 因此,当我运行该窗口应用程序(c#)时,我开发了Windows应用程序,它从扫描仪扫描了硬拷贝,该窗口应用程序在后台运行,因此我需要运行该窗口应用程序。 when user button click in asp.net web application 当用户按钮单击asp.net Web应用程序时

You cannot run applications from a website on client's machine due to security & permissions. 由于安全性和权限的原因,您无法从客户端计算机上的网站运行应用程序。

However, your website probably can communicate with the scanner. 但是,您的网站可能可以与扫描仪通信。 Check this detailed answer . 检查这个详细的答案

While you cannot run the application from the browser, there is another option, if your application is already running in the background. 虽然您无法从浏览器运行该应用程序,但是如果您的应用程序已经在后台运行,则还有另一个选择。 Then you can make it listen to some local port and then ask the browser to redirect to the URL (consisting of localhost and that port, eg http://localhost:34554 ), so the application would receive an HTTP request and will know it needs to become active / show its window / etc. Using this technique, you could even pass some parameters to your application using query params in the URL. 然后,您可以让它侦听某个本地端口,然后要求浏览器重定向到URL(由localhost和该端口组成,例如http://localhost:34554 ),因此应用程序将收到HTTP请求并知道它需要激活/显示其窗口等。使用此技术,您甚至可以使用URL中的查询参数将一些参数传递给您的应用程序。

Another option that allows you kinda run an application from the browser is Microsoft ClickOnce - it is just a simplified way of installing and running an application without the need for the user to download and manually run the installer. 允许您从浏览器运行应用程序的另一种选择是Microsoft ClickOnce-这只是安装和运行应用程序的一种简化方法,而无需用户下载并手动运行安装程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM