Crear acceso directo


/ Published in: C
Save to your folder(s)

Se requiere hacer referencia a la dll `Interop.IWshRuntimeLibrary`.


Copy this code and paste it in your HTML
  1. using IWshRuntimeLibrary;
  2.  
  3. ...
  4.  
  5. public static void CreateShortcut(string linkFilename, string description, string targetPath, string iconLocation, int iconIndex)
  6. {
  7. IWshShortcut_Class shortcut = (IWshShortcut_Class)new IWshShell_ClassClass().CreateShortcut(linkFilename);
  8. shortcut.Description = description;
  9. shortcut.TargetPath = targetPath;
  10. shortcut.IconLocation = iconLocation + "," + iconIndex;
  11. shortcut.Save();
  12. }
  13.  
  14. ...
  15.  
  16. Call that method like this:
  17.  
  18. CreateShortcut(linkFilename, description, targetPath, targetPath, 0);

URL: http://www.eggheadcafe.com/community/aspnet/14/26241/here-is-how-to-do-it-usin.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.