J
John Hite
I'm writing an ASP.NET Web application in C# that has the following
directory structure:
MyApp\bin\MyApp.dll
MyApp\conf\config.xml
MyApp\webapp.aspx
MyApp\webapp.aspx.cs
ok. The MyApp.dll was created by Visual Studio, webapp.aspx is my
webapp, and webapp.aspx.cs is my codebehind page. I would like to be
able to load and parse the config.xml file when the application
starts. Here is the code I use to open the config file.
XmlTextReader xmlReader= new
XmlTextReader(@"C:\WebApp\conf\config.xml");
Now...This works fine, but I would like to make it so that I don't
have a hard coded path to the config file. I would like to be able to
just say
XmlTextReader xmlReader= new XmlTextReader(@"conf\config.xml");
for example and be able to read the file, but this doesn't work.
whenever I do this I get an error message:
Could not find file "C:\WINDOWS\system32\conf\config.xml".
Any suggestions?
Thanks
directory structure:
MyApp\bin\MyApp.dll
MyApp\conf\config.xml
MyApp\webapp.aspx
MyApp\webapp.aspx.cs
ok. The MyApp.dll was created by Visual Studio, webapp.aspx is my
webapp, and webapp.aspx.cs is my codebehind page. I would like to be
able to load and parse the config.xml file when the application
starts. Here is the code I use to open the config file.
XmlTextReader xmlReader= new
XmlTextReader(@"C:\WebApp\conf\config.xml");
Now...This works fine, but I would like to make it so that I don't
have a hard coded path to the config file. I would like to be able to
just say
XmlTextReader xmlReader= new XmlTextReader(@"conf\config.xml");
for example and be able to read the file, but this doesn't work.
whenever I do this I get an error message:
Could not find file "C:\WINDOWS\system32\conf\config.xml".
Any suggestions?
Thanks