How can I get the application's path in a .NET console application?

后端 未结 27 1411
甜味超标
甜味超标 2020-11-21 11:11

How do I find the application\'s path in a console application?

In Windows Forms, I can use Application.StartupPath to find the current path, but this d

27条回答
  •  盖世英雄少女心
    2020-11-21 12:03

    You can simply add to your project references System.Windows.Forms and then use the System.Windows.Forms.Application.StartupPath as usual .

    So, not need for more complicated methods or using the reflection.

提交回复
热议问题