以下是ASP添加網(wǎng)頁(yè)快捷方式到電腦桌面的代碼:
<%
Response.ContentType="APPLICATION/OCTET-STREAM"
Response.AddHeader "Content-Disposition","attachment;filename="&"廣州網(wǎng)站建設(shè).url" '生成的文件名字
Response.Write("[InternetShortcut]")&Chr(13)
Response.Write("URL=http://"&host&""&sdir&"")&Chr(13)
Response.Write("IconFile=http://www.zxq0411.com/favicon.ico")&Chr(13) '生成的桌面圖標(biāo)
Response.Write("IDList=")&Chr(13)
Response.Write("[{000214A0-0000-0000-C000-000000000046}]")&Chr(13)
Response.Write("Prop3=19,2")&Chr(13)
Response.End
%>
如果是PHP添加網(wǎng)頁(yè)快捷方式到電腦桌面的則是下面的代碼:
<?php
if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content='
[DEFAULT]
BASEURL=http://www.zxq0411.com/
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.zxq0411.com/
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=http://www.zxq0411.com/favicon.ico
IconIndex=1
HotKey=0
Prop3=19,2';
header("Content-type:application/octet-stream");
header("Content-Disposition:attachment; {$title}.url;");
echo $content;
?>