zoukankan      html  css  js  c++  java
  • 把网址添加到桌面在本地创建网站的快捷方式

     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
     3 <head>
     4     <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
     5     <title></title>
     6 </head>
     7 <body>
     8     <script language="JavaScript">
     9         function toDesktop(sUrl,sName){
    10         try   
    11           {  
    12          var WshShell = new ActiveXObject("WScript.Shell");
    13          var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") + "\\" + sName + ".url");
    14          oUrlLink.TargetPath = sUrl;
    15          oUrlLink.Save();
    16           }   
    17           catch(e)   
    18           {
    19                   alert("当前IE安全级别不允许操作!");   
    20           }
    21         }
    22     </script>
    23 <input name="btn" type="button" id="btn" value="百度" onClick="toDesktop('http:\//www.baidu.com/','百度')">
    24 <input name="btn" type="button" id="btn" value="C盘" onClick="toDesktop('file:\//C:','C盘')">
    25 </body>
    26 </html>

    方法二:

     1 <?php
     2 $Shortcut = "[InternetShortcut]
     3 URL=http://www.baidu.com/
     4 IDList=
     5 [{000214A0-0000-0000-C000-000000000046}]
     6 Prop3=19,2
     7 ";
     8 Header("Content-type: application/octet-stream");
     9 header("Content-Disposition: attachment; filename=百度.url;");
    10 echo $Shortcut;
    11 ?>
  • 相关阅读:
    第07组 Alpha冲刺(2/6)
    第07组 Alpha冲刺(1/6)
    第07组 团队Git现场编程实战
    团队项目-需求分析报告
    团队项目-选题报告
    [面试]快来测测你的C++水平
    [技术博客] 数据库1+N查询问题
    【Beta】Scrum meeting 10
    【Beta】Scrum meeting 9
    [技术博客] gitlab快速部署流程
  • 原文地址:https://www.cnblogs.com/dudumao/p/2706182.html
Copyright © 2011-2022 走看看