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 Asp.net we use Request.PhysicalApplicationPath property. So is there any method or property exists that will give me the root of my project
+2
A:
You can use:
Gets the current working directory of the application.
You can then append "Reports" to that using
Dim reportsFolder As String
reportsFolder = Path.Combine(Directly.GetCurrentDirectory(), "Reports")
ChrisF
2010-06-08 10:32:38
Amit Ranjan
2010-06-08 11:06:21
@Amit - yes, unless you put the location into the app.config directory and read it from there.
ChrisF
2010-06-08 11:52:00
Then in this case after deployment user need to update the app.config file each and every time he moves Reports directory.
Amit Ranjan
2010-06-08 12:13:37
@Amit - unless you provide a settings dialog option for them to update it.
ChrisF
2010-06-08 12:17:28
+1
A:
When running in the IDE vs. Installed I have used:
If System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed - true if installed, false IDE
installed - System.Deployment.Application.ApplicationDeployment.CurrentDeployment.DataDirectory
IDE - My.Application.Info.DirectoryPath
dbasnett
2010-06-08 11:35:12
anyways i need to do some parsing over the string or copy paste it to executable dir..anyways thanks for kind support..
Amit Ranjan
2010-06-08 12:19:20