把网页发送到桌面代码

把网页发送到桌面相信很多站长都会用到,可有的站长可能不会写,今天碎碎就给大家分享下把网页发送到桌面php和asp良种语言的代码。

  首先我们先做准备工作,要先上传自己网站的ioc文件,这样发送到桌面的时候才会有图标显示。

  然后新建一个以shorturl命名的php文件把下面的代码放上去

<?php
$Shortcut = "[InternetShortcut]
URL=http://zsuisui.cn/
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
Header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=碎遇静安.url;");
echo $Shortcut;
?>

然后保存后传到网站的根目录,

在网站调用页面添加如下代码即可。

<ahref='http://zsuisui.cn/shorturl.php'>发送到桌面</a>

asp的和php的用法是一样的,代码不同,我也给大家贴出来.

<%
Response.ContentType="APPLICATION/OCTET-STREAM"
Response.AddHeader "Content-Disposition","attachment;filename="&"碎遇静安.url"
Response.Write("[InternetShortcut]")&Chr(13)
Response.Write("URL=http://zsuisui.cn")&Chr(13)
Response.Write("IDList=")&Chr(13)
Response.Write("[{000214A0-0000-0000-C000-000000000046}]")&Chr(13)
Response.Write("Prop3=19,2")&Chr(13)
Response.End
%>

ps:记得要把地址和标题改成自己的啊。要不就悲剧了

在给大家分享一个掉系统图片的代码,php的。

<?php
$Shortcut = "[InternetShortcut]
URL=http://zsuisui.cn/
IDList=
IconFile=C:Windowssystem32SHELL32.dll //这个是调系统里面的图标
IconIndex=160 //这个是第160个,根据自己需要拉
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
Header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=碎遇静安.url;");
echo $Shortcut;
?>
原文地址:https://www.cnblogs.com/webqiand/p/4602608.html