Best way to get application folder path

前端 未结 10 2300
無奈伤痛
無奈伤痛 2020-11-22 02:03

I see that there are some ways to get the application folder path:

  1. Application.StartupPath
  2. System.IO.Path.GetDirectoryName( System.
10条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 02:50

    I have used this one successfully

    System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName)
    

    It works even inside linqpad.

提交回复
热议问题