/ Published in: C
URL: http://www.eggheadcafe.com/community/aspnet/14/26241/here-is-how-to-do-it-usin.aspx
Se requiere hacer referencia a la dll Interop.IWshRuntimeLibrary.
Expand |
Embed | Plain Text
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);
You need to login to post a comment.
