欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2014年05月08日 09:44:28   作者:  
這篇文章主要介紹了PHP實(shí)現(xiàn)生成網(wǎng)站快捷方式并下載到桌面的方法,比加入收藏、設(shè)為首頁(yè)更給力哦,需要的朋友可以參考下

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

php實(shí)現(xiàn)代碼:

復(fù)制代碼 代碼如下:

<?php
if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content='
[DEFAULT]
BASEURL=http://www.dbjr.com.cn/?desktop
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.dbjr.com.cn/?desktop
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=http://www.dbjr.com.cn/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)代碼:

復(fù)制代碼 代碼如下:

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

Shortcut = "[DEFAULT]" & vbCrLf
Shortcut = Shortcut & "BASEURL=http://www.dbjr.com.cn/?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.dbjr.com.cn/?desktop" & vbCrLf
Shortcut = Shortcut & "IDList=[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & "IconFile=http://www.dbjr.com.cn/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)訪問(wèn)時(shí)即下載到了一個(gè)定制的網(wǎng)站快捷方式。但是這個(gè)功能的作用卻可能是很大的,你可以設(shè)置其默認(rèn)圖標(biāo)與如我的電腦、網(wǎng)上鄰居、文件夾等相同,而且因?yàn)樗钦5目旖莘绞?,不?huì)被殺毒軟件等查殺,因此也常被一些黑客行為所使用,以帶來(lái)巨大的真實(shí)訪問(wèn)流量。

相關(guān)文章

最新評(píng)論