网站快捷方式生成背景与概述
大多数网站都会提供“加入收藏”或“设为首页”等按钮功能,部分站点还具备“放到桌面”的特性。以下提供了基于PHP的生成快捷方式并下载至桌面的实现代码,内容摘录自网络并经过修改,仅供参考使用。
以下是PHP语言的实现代码:
复制代码 代码如下:
以下是ASP语言的实现代码:
复制代码 代码如下: <% id = int(request("id")) if id="" then id="1" title = request("title") if title="" then title="本站"
Shortcut = "[DEFAULT]" & vbCrLf Shortcut = Shortcut & "BASEURL=https://www.jb51.net/?desktop" & vbCrLf Shortcut = Shortcut & "[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf Shortcut = Shortcut & "Prop3=19,2" & vbCrLf Shortcut = Shortcut & "[InternetShortcut]" & vbCrLf Shortcut = Shortcut & "URL=https://www.jb51.net/?desktop" & vbCrLf Shortcut = Shortcut & "IDList=[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf Shortcut = Shortcut & "IconFile=https://www.jb51.net/favicon.ico" & vbCrLf Shortcut = Shortcut & "IconIndex=" & id & vbCrLf Shortcut = Shortcut & "HotKey=0" & vbCrLf Shortcut = Shortcut & "Prop3=19,2" & vbCrLf
Response.AddHeader "Content-Dispositon", "attachment;filename=" & title & ".url"; Response.ContetType = "application/octet-steam" Response.Write Shortcut %>
其核心原理是将URL快捷方式的文本内容作为附件强制输出,用户在访问时即可下载到一个定制的网站快捷方式。该功能允许自定义默认图标,使其外观与“我的电脑”、“网上邻居”或文件夹相似。由于它属于正常的系统快捷方式文件,通常不会触发杀毒软件的查杀机制,因此也常被黑客利用以获取巨大的真实访问流量。