Creating New XmlFile
XmlTextWriter xml_writer = new XmlTextWriter(Server.MapPath(path), null);
xml_writer.WriteStartDocument();
xml_writer.WriteRaw("");
xml_writer.WriteStartElement("Login_Details");
xml_writer.WriteEndElement();
xml_writer.WriteEndDocument();
xml_writer.Close();
For Updating Attributes Value OF Xml
XmlDocument xml_Doc = new XmlDocument();
xml_Doc.Load(Server.MapPath(path));
foreach (XmlNode node in xml_node)
{
if (node.Attributes[0].InnerText.ToString()=="Test")
{
node.Attributes[0].InnerText = "Text_Modified";
}
}
xml_Doc.Save(Server.MapPath(path));
No comments:
Post a Comment