user123 user123 - 1 year ago 198
C# Question

How can i get current application folder path in c# windows application

I created one folder like

to my application and how can i get that folder.

I took below code

string pathname = System.Environment.CurrentDirectory(Application.ExecutablePath);

by using the above code i am getting with

I need to get my folder name

Please help me out.

Thank you

Answer Source

if the DownloadFile folder is in the main folder of you project you can "go up" 2 folders from "bin\debug" and "go into" DownloadFile.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download