Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to set correct path to some file

How to set correct path to some file

Scheduled Pinned Locked Moved ASP.NET
xmltutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    papa1980
    wrote on last edited by
    #1

    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:->

    V S 2 Replies Last reply
    0
    • P papa1980

      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:->

      V Offline
      V Offline
      VenkataRamana Gali
      wrote on last edited by
      #2

      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

      P 1 Reply Last reply
      0
      • V VenkataRamana Gali

        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

        P Offline
        P Offline
        papa1980
        wrote on last edited by
        #3

        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'.

        1 Reply Last reply
        0
        • P papa1980

          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:->

          S Offline
          S Offline
          sparkling star
          wrote on last edited by
          #4

          Hi try this string url=HttpContext.Current.Server.MapPath("xmlNames.xml"); smiles shema

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups