我基本上想检查当前程序是否已经链接到 Windows 启动文件夹,即使该文件有另一个名称或从另一个目录运行。这可能吗,也许通过检查程序的名称?
PS:我使用此代码将我的程序链接到 Startup 文件夹:
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(Environment.GetFolderPath(Environment.SpecialFolder.Startup));
}
谢谢。