制作。net安装程序时候利用合并模块时候如何实现快捷方式的创建?

Csharpbull 2008-02-15 11:08:59
最近在制作。net安装程序,我使用的是合并模块方式来制作的,现在我想给其中的某个模块增加一个快捷方式应该怎么操作,还有怎么增加卸载的快捷方式,谢谢。。。。

...全文
50 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2008-02-15
  • 打赏
  • 举报
回复
using System;
using IWshRuntimeLibrary;

class Program
{
 static void Main(string[] args)
 {
  WshShell shell = new WshShell();
  IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(
    Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) +
    "\\" + "Allen’s Application.lnk"
  );
  shortcut.TargetPath = System.Reflection.Assembly.GetExecutingAssembly().Location;
  shortcut.WorkingDirectory = System.Environment.CurrentDirectory;
  shortcut.WindowStyle = 1;
  shortcut.Description = "Launch Allen’s Application";
  shortcut.IconLocation = System.Environment.SystemDirectory + "\\" + "shell32.dll, 165";
  shortcut.Save();
 }
}
别处拷来的。
建立一个shell,然后调用方法。

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧