I am trying to access the folder from winform application using the below code but its give me this path
D:\myproject\abc\bin\Debug\..\xml\list.xml
But my folder is is in this location
D:\myproject\abc\xml\list.xml
I am using this code for access xml file
protected void GetProcess()
{
var ps = Process.GetProcesses();
pictureBox1.Visible = true;
label2.Text = "Tracking Downloader";
foreach (var p in ps)
{
try
{
Process[] proc = Process.GetProcessesByName(p.ProcessName);
XDocument xdoc = XDocument.Load("..\\xml\\lst");
var block = xdoc.Descendants("lst");
foreach (var list in block)
{
if (proc[0].MainModule.FileVersionInfo.FileDescription.Contains(list.Value) )
{
p.Kill();
}
}
// listBox1.Items.Add(proc[0].MainModule.FileVersionInfo.FileDescription);
}
catch
{
Console.WriteLine("Access Denied");
}
}
//pictureBox1.Visible = false;
label2.Visible = true;
Console.ReadLine();
}
Experts Please Help. Thanks