Heim  >  Artikel  >  php教程  >  PHP创建桌面快捷方式实例,php快捷方式实例

PHP创建桌面快捷方式实例,php快捷方式实例

WBOY
WBOYOriginal
2016-06-13 09:29:452302Durchsuche

PHP创建桌面快捷方式实例,php快捷方式实例

要利用php创建桌面快捷方式我们需要借助于header,InternetShortcut及一些我看不懂的代码。

方法:新建一个php文件,然后把下面的代码扔进去,保存为比如shortcut.php,放在网站跟目录,代码如下:

<span>$shortCut</span> = "<span>[InternetShortcut]  
URL=http://www.baidu.com  
IDList=  
[{000214A0-0000-0000-C000-000000000046}]  
Prop3=19,2  
</span>"<span>;  
</span><span>Header</span>("Content-type: application/octet-stream"<span>);  
</span><span>header</span>("Content-Disposition: attachment; filename=baidu.url;"<span>);  
</span><span>echo</span> <span>$shortCut</span>; 

 

用PHP写一个下载页面到桌面的快捷方式的代码 网站打开后显示下面问题,问怎解决

你要写一个单独的页面来创建快捷方式,我估计你在这之前就有内容在页面上输出了,所以抱着个错

a.php
----------------------------------
$url = $_GET['url'];
$filename = urldecode($_GET['name']);
$filename = iconv('utf-8','GBk',$filename);//字符集转换
if (!$url || !$filename) exit();
$Shortcut = "[InternetShortcut]
URL={$url}
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename={$filename}.url;");
echo $Shortcut;

生成的时候做个超链接
快捷方式
 

javascript怎创建桌面快捷方式

网上常见的都是调用
WshShell.CreateShortcut但是只有ie支持ActiveXObject对象
所以要想实现只能跑后台 然后传回一个快捷方式
类似下载文件一样
给你找了段php的例子

 

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn