谈到使用代码实现网站快捷方式保存到桌面,我们不得不提下使用PHP代码的方式实现网站页面快捷保存到桌面,下面是PHP代码实现的通用方式:
<?php $Shortcut = "[InternetShortcut] URL=http://www.vevb.com IconFile=http://www.vevb.com/favicon.ico IconIndex=0 HotKey=1613 IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2"; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=武林网.url"); echo $Shortcut; ?>
以上代码就是我们经常用到的PHP实现网址快捷保存到桌面的代码,把上面这段代码放保存为desk.php在需要的调用直接调用就可以。
<a href="/desk.php">保存到桌面</a>
有兴趣的朋友收藏起来,而今天织梦模板网给大家介绍的是帝国CMS专用的将网址快捷方式保存到桌面,使用帝国CMS的用户可以留心看下。
帝国CMS专用的保持快接链接到桌面的代码:
<?phprequire("e/class/connect.php");$add=$_GET;$id=$add["id"];$gname=$add["gname"];if ($gname==""){$gname=$public_r[sitename];$gname = urldecode($gname);$gname = mb_convert_encoding($gname,'GB2312','UTF-8');}$Shortcut = "[InternetShortcut] URL=http://".$_SERVER['HTTP_HOST']."/?desktop IDList=[{000214A0-0000-0000-C000-000000000046}]Prop3=19,2 "; Header("Content-type: application/octet-stream;");header("Content-Disposition: attachment; filename=".$gname.".url;");echo $Shortcut;?>
使用方法
网站目录新建一个desk.php文件,复制以上代码到PHP文件中保存,直接在需要显示的地方链接这个文件就可以了:
<a href="/desk.php">保存到桌面</a>
新闻热点
疑难解答