Amit Ranjan Amit Ranjan - 1 year ago 113 Question

How do I get path of the Directory inside my WinForm app project

I have a directory named reports inside my winform project in .net. My project name is AccountingReports and inside that Directory reports exists. So i need the way to access this path via code. In we use Request.PhysicalApplicationPath property. So is there any method or property exists that will give me the root of my project

Answer Source

You can use:


Gets the current working directory of the application.

You can then append "Reports" to that using the following:

Path.Combine(string, string):

Dim reportsFolder As String
reportsFolder = Path.Combine(Directory.GetCurrentDirectory(), "Reports")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download