xmlcontent is a string containg the xml data.It is used to generate xml content for the newly created xml file.
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlcontent);
string date = System.DateTime.Now.ToString();
date = date.Replace("/", "_");
date = date.Replace(":", "-");
date = date.Replace(" ", "$");
string filename = date + "@Test.xml";
FileInfo fi = new FileInfo(MapPath("Temp//") + filename);
FileStream fstr = fi.Create();
fstr.Flush();
fstr.Close();
string filepath = Server.MapPath("Temp//");
xmlDoc.Save(filepath + filename);
No comments:
Post a Comment