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. General Programming
  3. C#
  4. relative XML file path

relative XML file path

Scheduled Pinned Locked Moved C#
xmlhelpquestionworkspace
3 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    is it possible to give relative XML file path so that when a setup is installed on other machines,it fetches XML itself? private string m_strFileName = "account.xml"; it`s giving error thanks

    H G 2 Replies Last reply
    0
    • L Lost User

      is it possible to give relative XML file path so that when a setup is installed on other machines,it fetches XML itself? private string m_strFileName = "account.xml"; it`s giving error thanks

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      Relative to what? When using the IO classes files are already relative to the application's - not the library in which your code runs - current working directory, not necessary the application's installation directory. You can get the current working directory by getting Environment.CurrentDirectory and the application's installation directory by getting Application.ExecutablePath, passing that to Directory.GetParent. Depending on what installation technology you're using you can also get the exact path to any file regardless of what type it is. Since you didn't provide any details about what you're trying to do, however, it's impossible to help you. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

      1 Reply Last reply
      0
      • L Lost User

        is it possible to give relative XML file path so that when a setup is installed on other machines,it fetches XML itself? private string m_strFileName = "account.xml"; it`s giving error thanks

        G Offline
        G Offline
        Gregg Holter
        wrote on last edited by
        #3

        Hi! Try this: private string m_strFileName = ".\\account.xml"; ---------------------- Seeing the infinite...

        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