且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何让我的网站链接执行?

更新时间:2023-12-02 15:35:58

如果开始从网页的过程是可能的,这将是病毒公路。

If starting a process from a webpage was possible, this would be a highway for viruses.

当然,我想你理解HTTP模式。网页实际上是在服务器上的服务器上执行时,所有的code运行。客户端浏览器只显示从一次HTTP请求/响应收到的HTML。

Of course, I assume you understand the http model. The webpage is actually executed on the server, all the code runs on the server. The client browser only display the html received from the one time http request/response.

您可以但是,正如你猜到了,创建自定义URL方案(yourapp:// yourquery)。该客户端必须注册一个应用程序来处理此类URL(这是磁铁链接是如何工作的)。

You can however, as you guessed, create custom url Scheme (yourapp://yourquery). The client side has to register an application to handle such urls (that's how the magnet links works).

MSDN页面的更多信息:注册到URL协议的应用一>

不过,我强调了微软说:

However, I emphasis what Microsoft says :

如何让我的网站链接执行?安全警告应用可以处理URL
  协议必须考虑如何以恶意数据作出反应。因为
  处理应用程序可以接收来自不受信任来源的数据,该网址
  并传递给应用程序的其他参数值可以含有
  试图利用处理应用程序恶意数据。

Security Alert Applications that handle URL protocols must consider how to respond to malicious data. Because handler applications can receive data from untrusted sources, the URL and other parameter values passed to the application may contain malicious data that attempts to exploit the handling application.

这可能会导致严重的问题,如果应用程序不知道如何处理恶意数据。

This can lead to serious problem if the application does not know how to handle malicious data.