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>;
你要写一个单独的页面来创建快捷方式,我估计你在这之前就有内容在页面上输出了,所以抱着个错
网上常见的都是调用
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;
生成的时候做个超链接
快捷方式
WshShell.CreateShortcut但是只有ie支持ActiveXObject对象
所以要想实现只能跑后台 然后传回一个快捷方式
类似下载文件一样
给你找了段php的例子

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
