开发者

Create a application shortcut [duplicate]

开发者 https://www.devze.com 2023-01-18 00:15 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: H开发者_如何学运维ow do you create an application shortcut (.lnk file) in C# or .Net
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

H开发者_如何学运维ow do you create an application shortcut (.lnk file) in C# or .Net

I guys I needed a help on how to create a application shortcut programmaticaly in c#


Try this.

http://vbaccelerator.com/article.asp?id=4301

  private static void configStep_addShortcutToStartupGroup()
    {
            using (ShellLink shortcut = new ShellLink())
            {
                    shortcut.Target = Application.ExecutablePath;
                    shortcut.WorkingDirectory = Path.GetDirectoryName(Application.ExecutablePath);
                    shortcut.Description = "My Shorcut Name Here";
                    shortcut.DisplayMode = ShellLink.LinkDisplayMode.edmNormal;
                    shortcut.Save(
                            STARTUP_SHORTCUT_FILEPATH);
            }
    }

Here is a CodeProject example on the same topic.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号