Summary of saved website addresses to desktop shortcuts

Source: Internet
Author: User
Tags urlencode

Practices in windows

The code is as follows: Copy code

[InternetShortcut]
URL = http://www.111cn.net/
Modified = 704A92F76804CA017A
IconIndex = 137
IconFile = C: WINDOWSsystem32SHELL32. dll
HotKey = 0
IDList =
[InternetShortcut. A]
[InternetShortcut. W]
[{000214A0-0000-0000-C000-000000000046}]
Prop3 = 19,2


Save the following code as a shortcut cut. Php file. Click the link to download the website icon shortcut to the desktop.


The ico icon may not be displayed in different systems. Please try the following code:

XML/HTML code

The code is as follows: Copy code
1. [DEFAULT]
2. BASEURL = http://www.111cn.net/
3. [InternetShortcut]
4. URL = http://www.111cn.net/#shortcut
5. Modified = 70BF4B88E372CC0124
6. IconFile = http://www.111cn.net//faviconbig.ico
7. IconIndex = 1

The above code

If urlencode is not used in, the obtained Chinese file name will be garbled, and urldecode must be used in Firefox. Using urlencode will also cause garbled file names, I will try again later. I used the following method to judge the browser type and used different methods to solve the garbled problem.

 

The code is as follows: Copy code

<? Php
$ Browser = strtolower (browser ());
$ Filename = 'Notes for php programmers ';
If ($ browser = 'Firefox '){
$ Filename = urldecode ($ filename );
} Else {
$ Filename = urlencode ($ filename );
}
$ Url = 'http: // www.phpernote.com /';
$ Shortcuts = '[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 $ Shortcuts;

Function browser (){
$ User_agent = $ _ SERVER ['http _ USER_AGENT '];
If (false! = Strpos ($ user_agent, 'msie 9.0 ')){
Return 'ie9 ';
 }
If (false! = Strpos ($ user_agent, 'msie 8.0 ')){
Return 'ie8 ';
 }
If (false! = Strpos ($ user_agent, 'msie 7.0 ')){
Return 'ie7 ';
 }
If (false! = Strpos ($ user_agent, 'msie 6.0 ')){
Return 'ie6 ';
 }
If (false! = Strpos ($ user_agent, 'Firefox ')){
Return 'Firefox ';
 }
If (false! = Strpos ($ user_agent, 'Chrome ')){
Return 'Chrome ';
 }
If (false! = Strpos ($ user_agent, 'Safari ')){
Return 'Safari ';
 }
If (false! = Strpos ($ user_agent, 'Opera ')){
Return 'Opera ';
 }
If (false! = Strpos ($ user_agent, '360se ')){
Return '360se ';
 }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.