c#.Net如何获取.exe快捷方式的路径?

c#.Net如何获取.exe快捷方式的路径?,c#,.net,clickonce,C#,.net,Clickonce,我通过ClickOnce部署了我的应用程序 我在桌面上创建了应用程序的快捷方式 Console.WriteLine(Directory.GetCurrentDirectory()); Console.WriteLine(); Console.WriteLine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); Console.WriteLine(

我通过ClickOnce部署了我的应用程序

我在桌面上创建了应用程序的快捷方式

        Console.WriteLine(Directory.GetCurrentDirectory());

        Console.WriteLine();

        Console.WriteLine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

        Console.WriteLine();

        Console.WriteLine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

        Console.ReadKey();
当我运行快捷方式时,我的应用程序只显示其当前位置,但显示错误。它显示实际安装的位置,但我想知道快捷方式所在的位置,在本例中是我的桌面

        Console.WriteLine(Directory.GetCurrentDirectory());

        Console.WriteLine();

        Console.WriteLine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));

        Console.WriteLine();

        Console.WriteLine(System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));

        Console.ReadKey();

以上任何一项都不能提供我正在运行的快捷方式的位置。

快捷方式的“起始位置”字段中指定的目录将设置
GetCurrentDirectory()的初始值。
。如果未指定,则将其设置为运行EXE的目录。如果您想要快捷方式本身的路径,那么在 StuttupFin.LPTECT/<代码>字段中的Win32函数中,该路径是可用的。当<代码> StfftTycliLNKNAMEN/CODE>标志被启用。@ RemyLebeau是C++。您可以。@ ReMyLeBeu谢谢。@ ReMyLeBeAu您的解决方案不起作用,因为CLIKONEN快捷方式不是类型。它们是应用程序引用。在快捷方式的“起始位置”字段中指定的目录将设置
GetCurrentDirectory()
的初始值。如果未指定,则将其设置为运行EXE的目录。如果您想要快捷方式本身的路径,那么在 StuttupFin.LPTECT/<代码>字段中的Win32函数中,该路径是可用的。当<代码> StfftTycliLNKNAMEN/CODE>标志被启用。@ RemyLebeau是C++。您可以。@ ReMyLeBeu谢谢。@ ReMyLeBeAu您的解决方案不起作用,因为CLIKONEN快捷方式不是类型。它们是应用程序参考。