How do I specify a new Uri path?
XML / XSL
1
Posts
1
Posters
0
Views
1
Watching
-
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.