how to get the application physical path in windows forms application

后端 未结 5 624
滥情空心
滥情空心 2020-12-16 04:20

how to get the application path in windows forms , i used the bellow code but it is saying like \"method not found\"

Application.ExecutablePath;
Application.         


        
相关标签:
5条回答
  • 2020-12-16 05:00

    This will return the complete path to your Application

    System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location)
    
    0 讨论(0)
  • 2020-12-16 05:03

    You can do it like this as well

              System.AppDomain.CurrentDomain.BaseDirectory
    
    0 讨论(0)
  • 2020-12-16 05:05

    System.Windows.Forms.Application.StartupPath must return the path of the running executable.

    0 讨论(0)
  • 2020-12-16 05:06

    Add reference System.Windows.Forms and add in using section

    using System.Windows.Forms;
    
    0 讨论(0)
  • 2020-12-16 05:12

    Generally, Application.StartupPath() will give the path of the application. And also r u missing this namespace. System.Windows.Forms

    0 讨论(0)
提交回复
热议问题