namespace readtask
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
Process.Start(@"E:\SAMPLE PROJECTS\TaskName.xml");
}
}
}
Asked
Active
Viewed 202 times
-4

Deepak Sharma
- 4,124
- 1
- 14
- 31

athul k mavilayi
- 3
- 1
-
Read- https://stackoverflow.com/help/how-to-ask – Souvik Ghosh May 10 '18 at 04:22
-
what you have tried so far?? let us know, and we will guide what you have done wrong. the above doesn't seems to be related to your problem statement. – Deepak Sharma May 10 '18 at 04:22
-
Did you even google about "How to read xml file in C#"? Or you want us to do that? – Chetan May 10 '18 at 04:25
-
i can read a xml document..from that document i need information eg:
stddetails – athul k mavilayi May 10 '18 at 04:30athul ..from this i want to fetch name:athul to a note pad .For that what should i do...i am a begginer -
i am using via windows form application – athul k mavilayi May 10 '18 at 04:37
1 Answers
0
There are one to many ways to achieve this:
using System;
using System.IO;
using System.Xml;
public class SampleXML
{
public static void Main()
{
//Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.Load("TaskName.xml");
//Display the desired tag.
XmlNodeList elemList = doc.GetElementsByTagName("name");
for (int i=0; i < elemList.Count; i++)
{
Console.WriteLine(elemList[i].InnerXml);
}
}
}

DirtyBit
- 16,613
- 4
- 34
- 55
-
-
- – athul k mavilayi May 10 '18 at 05:06My first task scheduler \TaskName - THIS IS MY XML FILE2018-05-03T03:37:14 true -- 8 -
okay but you mentioned a different tag in the comments section, replace the `doc.GetElementsByTagName("name");` with any oter tag name – DirtyBit May 10 '18 at 05:08
-
I am using windows form application..then how i can use console.write function?? i used one button function am writing inside it – athul k mavilayi May 10 '18 at 05:54