ASP和PHP实现生成网站快捷方式并下载到桌面的方法 |
本文标签:ASP,PHP,生成网站快捷方式 在网站上设置“加入收藏、设为首页”等按钮是一般网站都会干的事儿,但是有的网站还有“放到桌面”这样的功能设置 。 php实现代码: 复制代码 代码如下: <?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实现代码: 复制代码 代码如下: <% id = int(request("id")) if id="" then id="1" title = request("title") if title="" then title="脚本之家" Shortcut = "[DEFAULT]" & vbCrLf Response.AddHeader "Content-Dispositon", "attachment;filename=" & title & ".url";
|