如何保存php网页到桌面,将网页的快捷方式保存到桌面的代码

由于最近几天在搞陈德馨博客的模板修改工作,看见有个站点有个功能,点击图片热点之后会把该站的快捷方式保存到桌面,于是自己也就花了点心思去研究了下。终于实现了这个功能,现在分享出来给大家。

PHP代码:<?php

$Shortcut = "[InternetShortcut]

URL=https://www.chendexin.com/?desktop

IDList=

IconFile=https://www.chendexin.com/favicon.ico

[{000214A0-0000-0000-C000-000000000046}]

Prop3=19,2

";

Header("Content-type: application/octet-stream");

header("Content-Disposition: attachment; filename=陈德馨博客.url;");

echo $Shortcut;

?>

ASP代码:

id=request("id")

liehuo_net_url=request("liehuo_net_url")

If liehuo_net_url="" Then liehuo_net_url="陈德馨博客"

Shortcut = "[InternetShortcut] " & vbCrLf

Shortcut = Shortcut & "URL=https://www.chendexin.com/?desktop" & vbCrLf

Shortcut = Shortcut & "IDList=" & vbCrLf

Shortcut = Shortcut & "IconFile=https://www.chendexin.com/favicon.ico" & vbCrLf

Shortcut = Shortcut & "[{000214A0-0000-0000-C000-000000000046}] " & vbCrLf

Shortcut = Shortcut & "Prop3=19,2 " & vbCrLf

Shortcut = Shortcut & " " & vbCrLf

Response.AddHeader "Content-Disposition", "attachment;filename="陈德馨博客".url;"

Response.ContentType = "application/octet-stream"

Response.Write Shortcut

%>

你只需要复制上面的源码,新建相应的ASP或PHP文件,然后在你的网页上添加一个链接,指向对应的文件就可以实现了。记得把上面的域名和网站名称改成你自己的域名和网站名称哦!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值