How to set correct path to some file
-
Hi i try to done some web application into net.2 pleas tell me how to set correct path to some file.Down is my code and this url give me exception.My path is not set correctly how to set it List list = new List(); string url =("xmlNames.xml"); XmlTextReader reader = new XmlTextReader(url); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { } } thank's a lot good bye and have nice day:->
-
Hi i try to done some web application into net.2 pleas tell me how to set correct path to some file.Down is my code and this url give me exception.My path is not set correctly how to set it List list = new List(); string url =("xmlNames.xml"); XmlTextReader reader = new XmlTextReader(url); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { } } thank's a lot good bye and have nice day:->
Hello put string url =(@"xmlNames.xml"); and now try it wont give any Exception(but xml file should exist in bin directory) regards GV Ramana
-
Hello put string url =(@"xmlNames.xml"); and now try it wont give any Exception(but xml file should exist in bin directory) regards GV Ramana
Now give me this exception.I don't remamber which exacly class is use for path is something like "Server.path" but i am not sure??? System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\xmlNames.xml'.
-
Hi i try to done some web application into net.2 pleas tell me how to set correct path to some file.Down is my code and this url give me exception.My path is not set correctly how to set it List list = new List(); string url =("xmlNames.xml"); XmlTextReader reader = new XmlTextReader(url); while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { } } thank's a lot good bye and have nice day:->
Hi try this string url=HttpContext.Current.Server.MapPath("xmlNames.xml"); smiles shema