Executable directory where application is running from?

前端 未结 6 1794
无人共我
无人共我 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:28

    Dim strPath As String = System.IO.Path.GetDirectoryName( _
        System.Reflection.Assembly.GetExecutingAssembly().CodeBase)
    

    Taken from HOW TO: Determine the Executing Application's Path (MSDN)

提交回复
热议问题