且构网

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

使用托管的asp.net应用程序在客户端计算机上创建快捷方式

更新时间:2022-12-23 19:30:07

Web应用程序在Web浏览器中运行,并且不允许访问浏览器外部的任何用户系统资源.因此,Web应用程序无法在用户的桌面上创建快捷方式.您需要指导用户创建桌面快捷方式.如果他愿意,那么他将创建快捷方式,否则不创建.

您编写的代码在服务器(或本地主机)上执行,并在其中创建快捷方式.但是对于用户而言,代码将在远程计算机上执行,而不是在其计算机上执行,以创建快捷方式.了解客户端-服务器体系结构.它根本不可能.

您是否在其他任何网站上看到过任何此类功能?
A web application runs inside the web browser and is not allowed to access any of the user''s system resources outside the browser. So a web app cannot create a shortcut on user''s desktop. You need to instruct the user to create the shortcut to his desktop. If he wants then he will create the shortcut otherwise not.

The code you have written executes on the server ( or your localhost) and creates the short cut there. But for a user, the code executes on the remote machine and NOT on his machine for the short cut to be created. Understand the client-server architecture. Its simply NOT possible.

Have you seen any such functionality on any other website ?


这是无法完成的,这是有原因的–网站无法(也永远不会)访问浏览器之外的客户端计算机.

如果用户使用Windows,只需告诉用户将链接或URL拖到桌面上即可.
This can''t be done, and for good reason – websites don''t (and never should) have access to the client machine outside the browser.

Simply tell your users to drag a link or URL onto the desktop, if they''re using Windows.