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. XML / XSL
  4. How do I specify a new Uri path?

How do I specify a new Uri path?

Scheduled Pinned Locked Moved XML / XSL
questionxml
1 Posts 1 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.
  • E Offline
    E Offline
    Etienne_123
    wrote on last edited by
    #1

    Hi guys I use the following to specify the Uri path for the XmlDataProvider dp:

    System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
    if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
    {
    string fileName = ofd.FileName;
    XmlDataProvider dp = this.FindResource("dpNewDS") as XmlDataProvider;
    dp.Source = new Uri(fileName);
    }

    Now I want to now, what if I don't want to use an OpenFileDialog to specify the path, but instead I want to specify it myself. I know typing in the folder address e.g C:\xmlfile.xml works fine, but I don't want to hard code the path. I want to keep the file in the "bin" folder, how do I specify the path to this folder? I tried various methods but none seemed to work.

    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