the first method:
Add the following reference: COM Under Windows Script Host Object Model, then
Using system.Runtime.InteropServices; Using IWshruntimelibrary;
String mysite = "http://mysite.com"; string fav = system.environment.GetFolderPath (System.Environment.SpecialFolder.favorites) "//mysite.URL";
// Create a Windows Script Host Shell Class IWSHSHELL_CLASS WSHSHELL = New IWSHELL_CLASSCLASS ();
// Define shortcut file IWSHURLSHORTCUT SHORTCUT = shell.createshortcut (FAV) AS IWSHURLSHORTCUT; Shortcut.targetPath = mysite
/ / Save shortcut shortcut.save ();
Using system.Runtime.InteropServices; Using IWshruntimelibrary;
String mysite = "http://mysite.com"; string fav = system.environment.GetFolderPath (System.Environment.SpecialFolder.favorites) "//mysite.URL";
// Create a Windows Script Host Shell Class IWSHSHELL_CLASS WSHSHELL = New IWSHELL_CLASSCLASS ();
// Define shortcut file IWSHURLSHORTCUT SHORTCUT = shell.createshortcut (FAV) AS IWSHURLSHORTCUT; Shortcut.targetPath = mysite
/ / Save shortcut shortcut.save ();
Using system.Runtime.InteropServices; Using IWshruntimelibrary;
String mysite = "http://mysite.com"; string fav = system.environment.GetFolderPath (System.Environment.SpecialFolder.favorites) "//mysite.URL";
// Create a Windows Script Host Shell Class IWSHSHELL_CLASS WSHSHELL = New IWSHELL_CLASSCLASS ();
// Define shortcut file IWSHURLSHORTCUT SHORTCUT = shell.createshortcut (FAV) AS IWSHURLSHORTCUT; Shortcut.targetPath = mysite
/ / Save shortcut shortcut.save ();
The second method:
Create a text file, enter the following [InternetShortcut] URL = http://www.microsoft.com/ The suffix is changed to ".url", you can.