ASP和PHP实现生成网站快捷方式并下载到桌面的方法
在网站上设置“加入收藏、设为首页”等按钮是一般网站都会干的事儿,但是有的网站还有“放到桌面”这样的功能设置。 php实现代码: 代码如下: if(isset($_GET[title]) && trim($_GET[title]) !== "") $title = trim($_GET[tilte]);
$content=' [DEFAULT] BASEURL=//www.52php.cn/?desktop [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 [InternetShortcut] URL=//www.52php.cn/?desktop IDList=[{000214A0-0000-0000-C000-000000000046}] IconFile=//www.52php.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实现代码: 代码如下: <%
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";
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |