网站公告:拥有属于您的高端高性价比的网站、从现在开始您的建站之旅吧(*^▽^*)
新闻动态 >> 返回 您当前所在位置:首页 > 新闻动态 > 正文

简单添加网页快捷方式到电脑桌面

更新时间:2017-01-14 20:46:43点击次数:2746次字号:T|T
以下是ASP添加网页快捷方式到电脑桌面的代码:

以下是ASP添加网页快捷方式到电脑桌面的代码:

<%

Response.ContentType="APPLICATION/OCTET-STREAM"
Response.AddHeader "Content-Disposition","attachment;filename="&"广州网站建设.url"  '生成的文件名字
Response.Write("[InternetShortcut]")&Chr(13)
Response.Write("URL=http://"&host&""&sdir&"")&Chr(13)
Response.Write("IconFile=http://www.71wl.com/favicon.ico")&Chr(13) '生成的桌面图标
Response.Write("IDList=")&Chr(13)
Response.Write("[{000214A0-0000-0000-C000-000000000046}]")&Chr(13)
Response.Write("Prop3=19,2")&Chr(13)
Response.End
%>

如果是PHP添加网页快捷方式到电脑桌面的则是下面的代码:
if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content='
[DEFAULT]
BASEURL=http://www.71wl.com/
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=http://www.71wl.com/
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=http://www.71wl.com/favicon.ico
IconIndex=1
HotKey=0
Prop3=19,2';
header("Content-type:application/octet-stream");
header("Content-Disposition:attachment; {$title}.url;");
echo $content;
?>
(编辑:cmh8)