We will see a lot of sites not only have set home page, add to the collection at the same time there is a plus and to the desktop shortcut function, below I to introduce you to create shortcuts to the desktop a variety of ways to introduce. If you need a friend, you can refer to it.
The simplest method of JS implementation
The code is as follows |
Copy Code |
|
Insufficient: Do this if the browser has made security settings we are not able to use the method above.
A friend who writes a PHP program may also know a way to code as follows
The code is as follows |
Copy Code |
$Shortcut = "[Internetshortcut] Url=http://www.bkjia.com Iconfile=http://www.bkjia.com/favicon.ico Iconindex=0 hotkey=1613 idlist= [{000214a0-0000-0000-c000-000000000046}] prop3=19,2 "; Header ("Content-type:application/octet-stream"); Header ("content-disposition:attachment; Filename= transformation without worry. url "); Echo $Shortcut; ?> Send to Desktop
|
ASP. NET programmers may also know the following code
The code is as follows |
Copy Code |
Using System; Using System.Data; Using System.Configuration; Using System.Collections; Using System.Web; Using System.Web.Security; Using System.Web.UI; Using System.Web.UI.WebControls; Using System.Web.UI.WebControls.WebParts; Using System.Web.UI.HtmlControls; public partial class CreateShortcut:System.Web.UI.Page { protected void Page_Load (object sender, EventArgs e) { } /// Create a shortcut /// ///Title ///URL address private void CreateShortcut (String Title, String URL) { String Strfavoritefolder; Create IE shortcuts in Favorite Folders Strfavoritefolder = System.Environment.GetFolderPath (Environment.SpecialFolder.Favorites); Createshortcutfile (Title, URL, Strfavoritefolder); Creating IE shortcuts in the desktop Strfavoritefolder = System.Environment.GetFolderPath (Environment.SpecialFolder.Desktop); Createshortcutfile (Title, URL, Strfavoritefolder); Create IE shortcuts in links Strfavoritefolder = System.Environment.GetFolderPath (Environment.SpecialFolder.Favorites) + "link"; Createshortcutfile (Title, URL, Strfavoritefolder); Create IE shortcuts from the Start menu Strfavoritefolder = System.Environment.GetFolderPath (Environment.SpecialFolder.StartMenu); Createshortcutfile (Title, URL, Strfavoritefolder); } /// Create a shortcut /// ///Title ///URL address ///Special folders private void Createshortcutfile (String Title, String URL, String specialfolder) { Create shortcut file, based on Title System.IO.StreamWriter objwriter = System.IO.File.CreateText (specialfolder + "+ Title +". url "); Write URL to File Objwriter.writeline ("[Internetshortcut]"); Objwriter.writeline ("url=" + URL); Close file Objwriter.close (); } private void Btnshortcut_click (object sender, System.EventArgs e) { CreateShortcut ("Home of the Script", http://www.bkjia.com); } } |
http://www.bkjia.com/PHPjc/444613.html www.bkjia.com true http://www.bkjia.com/PHPjc/444613.html techarticle we will see a lot of sites not only have set the homepage, add to the collection at the same time there is a plus and to the desktop shortcut function, below I give you introduce the page to create a shortcut to the desktop ...