仿開心網的設爲桌面

演示地址:http://www.kaixin001.com/interface/shortcut.phpphp

 

  
  
  
  
  1. public function shortcutAction(){$this->_helper->layout->disableLayout();  
  2. $this->_helper->viewRenderer->setNoRender( true );$url = site_url();$Shortcut = 」[InternetShortcut]  
  3. URL=」.$url.」IDList=IconIndex=43IconFile=/favicon.icoHotKey=1626[{000214A0-0000-0000-C000-000000000046}]Prop3=19,2″;Header(「Content-type: application/octet-stream」);header(「Content-Disposition: p_w_upload; filename=開心網.url」);echo $Shortcut;  

[ASP方法]app

演示地址:如:http://zhaijixin.com/shorturl.asp ide

就會有提示下載一個名爲 宅急信-青城最及時的房屋信息網.url 文件,保存在本地就是一個快捷方式!網站

 一、將下面的代碼保存爲文件,shorturl.asp。記得修改第二行及第四行內的url名稱和網址。this

<%
Response.ContentType=」APPLICATION/OCTET-STREAM」
Response.AddHeader 「Content-Disposition」,」p_w_upload;filename=」&」博士吧設計.url」
Response.Write(「[InternetShortcut]「)&Chr(13)
Response.Write(「URL=http://www.cnarrow.com」)&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
%>url

二、將該文件上傳至網站根目錄。
三、在網站根目錄上傳Favicon.ico文件,有這個文件,保存的連接纔會有圖標顯示。
四、在網站調用頁面添加以下代碼便可。
<a href=’http://www.boshi8.com/shorturl.asp’>桌面圖標</a>spa

 [PHP方法]設計

演示地址:http://www.kaixin001.com/interface/shortcut.php xml

另附PHP代碼,你們能夠嘗試一下,保存成shorturl.php便可,調用方式同asp。get

<?php
$Shortcut = 「[InternetShortcut]
URL=http://www.cnarrow.com/
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
「;
Header(「Content-type: application/octet-stream」);
header(「Content-Disposition: p_w_upload; filename=宏箭.url;」);
echo $Shortcut;
?>

 要想出現圖標請先確保網站根目錄中有 favicon.ico 文件 上傳到網站

相關文章
相關標籤/搜索