文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Create XML with LoadXml(string) i..

Create XML with LoadXml(string) i..

时间:2010-10-11  来源:yaoxin2010

using System;
using System.Xml;

public partial class create_xml_string : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
    {
      string xmlString = "<?xml version='1.0' encoding='UTF-8'?>";
      xmlString += "<products>";
        xmlString += "<product id='p3'>";
          xmlString += "<name>Alpha</name>";
          xmlString += "<price>1200</price>";
          xmlString += "<stock>19</stock>";
          xmlString += "<country>Germany</country>";
        xmlString += "</product>";
      xmlString += "</products>";

      XmlDocument doc = new XmlDocument();
      doc.LoadXml(xmlString);
      doc.Save(Server.MapPath("products-string.xml"));

      Response.Redirect("products-string.xml"); // load file in browser
    }
}

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载