日期:2009-12-31  浏览次数:20386 次

C#生成桌面快捷方式,如下代码:

  1. WindowsShortcut.Shortcut sc = new WindowsShortcut.Shortcut();   
  2.                 
  3. sc.Path = this.currentDir + "/平台启动器.exe";   
  4. sc.WorkingDirectory = this.currentDir;   
  5. sc.Description = "平台启动器";   
  6. string DesktopPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);//得到桌面文件夹   
  7.     
  8. sc.Save(DesktopPath + "/平台启动器.lnk");