private void CreateDesktop() { string path = this.Context.Parameters["targetdir"]; path = path.Substring(0, path.LastIndexOf("/")); if (!System.IO.File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "//" + "微信打印机.lnk")) { WshShell shell = new WshShell(); IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut( Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "//" + "微信打印机.lnk" ); shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location; shortcut.WorkingDirectory = System.Environment.CurrentDirectory; shortcut.WindowStyle = 1; //Normal window shortcut.Description = "微信打印机"; shortcut.IconLocation = path + "ico//desktop.ico"; shortcut.Save(); } }

 

相关文章:

  • 2021-09-13
  • 2022-02-25
  • 2022-01-26
  • 2021-11-18
  • 2021-06-20
  • 2022-02-27
  • 2021-06-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-04
  • 2021-10-30
  • 2021-07-27
  • 2021-05-02
  • 2021-10-25
  • 2021-08-01
相关资源
相似解决方案