简体   繁体   English

如何使网站执行链接?

[英]How do I make the website execute links?

I'm making a small webpage that is going to execute links, en specifics magnet links. 我正在制作一个小型网页,它将执行链接,具体来说就是磁铁链接。 But the webserveruserrole does not carry enough mojo (rights, Process.Start() ) to make that happen. 但是webserveruserrole没有足够的mojo(权利, Process.Start() )来实现这一目标。

I've tried to look for this user role but could not find it. 我试图寻找该用户角色,但找不到它。

How do I make the webserver execute/start magnet:?xt links? 如何使Web服务器执行/启动magnet:?xt链接?

If starting a process from a webpage was possible, this would be a highway for viruses. 如果可以从网页启动进程,那么这将是病毒的高速通道。

Of course, I assume you understand the http model. 当然,我假设您了解http模型。 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. 客户端浏览器仅显示从一次http请求/响应接收到的html。

You can however, as you guessed, create custom url Scheme (yourapp://yourquery). 但是,您可以根据自己的猜测创建自定义url方案(yourapp:// yourquery)。 The client side has to register an application to handle such urls (that's how the magnet links works). 客户端必须注册一个应用程序来处理此类URL(这就是磁铁链接的工作方式)。

More information on the msdn page: Registering an Application to a URL Protocol . 有关msdn页面的更多信息:将应用程序注册到URL协议

However, I emphasis what Microsoft says : 但是,我强调微软所说的话:

安全警报 Security Alert Applications that handle URL protocols must consider how to respond to malicious data. 处理URL协议的安全警报应用程序必须考虑如何响应恶意数据。 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. 因为处理程序应用程序可以从不受信任的来源接收数据,所以传递给应用程序的URL和其他参数值可能包含试图利用处理程序应用程序的恶意数据。

This can lead to serious problem if the application does not know how to handle malicious data. 如果应用程序不知道如何处理恶意数据,则可能导致严重的问题。

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

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