/ Published in: C
Se requiere hacer referencia a la dll `Interop.IWshRuntimeLibrary`.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
using IWshRuntimeLibrary; ... public static void CreateShortcut(string linkFilename, string description, string targetPath, string iconLocation, int iconIndex) { IWshShortcut_Class shortcut = (IWshShortcut_Class)new IWshShell_ClassClass().CreateShortcut(linkFilename); shortcut.Description = description; shortcut.TargetPath = targetPath; shortcut.IconLocation = iconLocation + "," + iconIndex; shortcut.Save(); } ... Call that method like this: CreateShortcut(linkFilename, description, targetPath, targetPath, 0);
URL: http://www.eggheadcafe.com/community/aspnet/14/26241/here-is-how-to-do-it-usin.aspx