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

前端 未结 7 1928
梦如初夏
梦如初夏 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 06:41

    If its an exe as in your case use:

        // Summary:
        //     Gets the path for the executable file that started the 
        //     application, not including the executable name.    
        Application.StartupPath
    

提交回复
热议问题