Executable directory where application is running from?

前端 未结 6 1783
无人共我
无人共我 2020-12-01 04:46

I need to get the path (not the executable) where my application is running from:

System.AppDomain.CurrentDomain.BaseDirectory()

When I run

6条回答
  •  悲哀的现实
    2020-12-01 05:08

    You can write the following:

    Path.Combine(Path.GetParentDirectory(GetType(MyClass).Assembly.Location), "Images\image.jpg")
    

提交回复
热议问题