1、将下面的代码保存为文件,shorturl.asp。记得修改第二行及第四行内的url名称和网址。
<%
Response.ContentType=
"APPLICATION/OCTET-STREAM"
Response.AddHeader
"Content-Disposition"
,
"attachment;filename="
&
"导航.url"
Response.Write(
"[InternetShortcut]"
);
Response.Write(
"URL=http://www.34ways.com"
);
Response.Write(
"IDList="
);
Response.Write(
"[{000214A0-0000-0000-C000-000000000046}]"
);
Response.Write(
"Prop3=19,2"
);
Response.
End
%>
2、将该文件上传至网站根目录。
3、在网站根目录上传Favicon.ico文件,有这个文件,保存的链接才会有图标显示。
4、在网站调用页面添加如下代码即可。
<a href='http://www.34ways.com/shorturl.asp'>桌面图标</a>
另附PHP代码,大家可以尝试一下,保存成shorturl.php即可,调用方式同asp。
<?php
$Shortcut
= "[InternetShortcut]
<pre>URL=http:
//www.cnarrow.com/
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
Header(
"Content-type: application/octet-stream"
);
header(
"Content-Disposition: attachment; filename=导航.url;"
);
echo
$Shortcut
;
?>
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有