国产精品成人VA在线观看,亚洲日韩在线中文字幕综合,亚洲AV电影天堂男人的天堂,久久人人爽人人爽人人av东京热

News新聞

業(yè)界新聞動態(tài)、技術(shù)前沿
Who are we?

您的位置:首頁      樂道系統(tǒng)FAQ      ASP和PHP實現(xiàn)生成網(wǎng)站快捷方式并下載到桌面的方法

ASP和PHP實現(xiàn)生成網(wǎng)站快捷方式并下載到桌面的方法

標(biāo)簽: 發(fā)布日期:2014-05-09 00:00:00 1120

在網(wǎng)站上設(shè)置“加入收藏、設(shè)為首頁”等按鈕是一般網(wǎng)站都會干的事兒,但是有的網(wǎng)站還有“放到桌面”這樣的功能設(shè)置。
下面即生成快捷方式并下載到桌面的php實現(xiàn)代碼,摘錄修改于網(wǎng)絡(luò),僅作參考

PHP代碼實現(xiàn)生成網(wǎng)站快捷方式并下載到桌面

<?php
if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content='
[DEFAULT]
BASEURL=http://www.jb51.net/?desktop
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.jb51.net/?desktop
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=http://www.jb51.net/favicon.ico
IconIndex=1
HotKey=0
Prop3=19,2';
header("Content-type:application/octet-stream");
header("Content-Disposition:attachment; {$title}.url;");
echo $content;
?>

ASP代碼實現(xiàn)生成網(wǎng)站快捷方式并下載到桌面

<%
id = int(request("id"))
if id="" then id="1"
title = request("title")
if title="" then title="腳本之家"

 

Shortcut = "[DEFAULT]" & vbCrLf
Shortcut = Shortcut & "BASEURL=http://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=http://www.jb51.net/?desktop" & vbCrLf
Shortcut = Shortcut & "IDList=[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & "IconFile=http://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快捷方式的內(nèi)容強(qiáng)制輸出為附件,當(dāng)訪問時即下載到了一個定制的網(wǎng)站快捷方式。但是這個功能的作用卻可能是很大的,你可以設(shè)置其默認(rèn)圖標(biāo)與如我的電腦、網(wǎng)上鄰居、文件夾等相同,而且因為它是正常的快捷方式,不會被殺毒軟件等查殺,因此也常被一些黑客行為所使用,以帶來巨大的真實訪問流量。