You must Sign In to post a response.
  • Category: WPF

    How to get application installation path c#

    i want to delete some files inside the application folder, so i need the exact path where our Windows application is installed to delete files
  • #756716
    Hi,

    Right click on your solution and then select properties option and in that you can able to find the path of your solution.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #756721
    Hai Ashok,
    There could be various ways to get the path of the executable in WPF WinForms applications:
    1. Using Reflection
    System.Reflection.Assembly.GetEntryAssembly().Location
    2. using Path class under System.IO
    Path.DirectoryName(Assembly.GetEntryAssembly().Location)
    Path.DirectoryName(Environment.GetCommandLineArgs()[0])
    3. Using Application class
    Application.StartupPath
    4. System.AppDomain.CurrentDomain.BaseDirectory
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


  • Sign In to post your comments