How to get the path of app(without app.exe)?

前端 未结 7 1902
梦如初夏
梦如初夏 2020-12-09 06:28

I want to get the path of my app like: \"\\\\ProgramFiles\\\\myApp\", I try to use the following code:


string path = System.Reflection.Assembly.GetExecuting         


        
7条回答
  •  失恋的感觉
    2020-12-09 07:00

    What about using a FileInfo object to extract the directory name?

    In Vb.Net:

    fi = New FileInfo(System.Reflection.Assembly.GetExecutingAssembly.Location)
    path = fi.DirectoryName
    

提交回复
热议问题