人人人妻人人人妻人人人,99精品国产综合久久久久五月天 ,欧美白人最猛性XXXXX,日韩AV无码免费播放

News新聞

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

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

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

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

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

PHP代碼實(shí)現(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代碼實(shí)現(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
%>

其生成原理很簡(jiǎn)單,即將url快捷方式的內(nèi)容強(qiáng)制輸出為附件,當(dāng)訪問時(shí)即下載到了一個(gè)定制的網(wǎng)站快捷方式。但是這個(gè)功能的作用卻可能是很大的,你可以設(shè)置其默認(rèn)圖標(biāo)與如我的電腦、網(wǎng)上鄰居、文件夾等相同,而且因?yàn)樗钦5目旖莘绞?,不?huì)被殺毒軟件等查殺,因此也常被一些黑客行為所使用,以帶來巨大的真實(shí)訪問流量。