I've inherited a .NET project that I'm debugging the code to. I'm
completely new to .net as well. I have a line in my code that reads an
XML file, however, I cannot figure out the reference point that a
relative path starts from. I.e., the following line

XmlTextReader reader = new XmlTextReader( "..\\..\\..\\filename.xml" )

points to "BaseURI "file:///C:/Program Files/filename.xml" string

When I step through the code even though my project is in
c:\projects\... I don't want to hard code a path into the code as that
wouldn't be practical. What is it starting point for the relative path
and how can I change it?

Thank you.

Rob


*** Sent via Developersdex http://www.developersdex.com ***

Re: xmlTextReader path to file by Vadym

Vadym
Wed Oct 10 05:26:43 PDT 2007

Hello, Rob!

Environment.CurrentDirectory contains path of the current working directory.
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Tue, 09 Oct 2007 09:30:55 -0700:

RT> I've inherited a .NET project that I'm debugging the code to. I'm
RT> completely new to .net as well. I have a line in my code that reads
RT> an
RT> XML file, however, I cannot figure out the reference point that a
RT> relative path starts from. I.e., the following line

RT> XmlTextReader reader = new XmlTextReader( "..\\..\\..\\filename.xml"
RT> )

RT> points to "BaseURI "file:///C:/Program Files/filename.xml" string

RT> When I step through the code even though my project is in
RT> c:\projects\... I don't want to hard code a path into the code as
RT> that wouldn't be practical. What is it starting point for the
RT> relative path and how can I change it?

RT> Thank you.

RT> Rob


RT> *** Sent via Developersdex http://www.developersdex.com ***