+ -
当前位置:首页 → 问答吧 → 入门xml问题?

入门xml问题?

时间:2010-08-17

来源:互联网

HTML code


 protected void Button1_Click(object sender, EventArgs e)
    {
        //操作四:添加一个节点
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("XMLFile/XMLFile.xml"));
        //创建一个新节点
        XmlElement newElement = xmlDoc.CreateElement("poems");
        //创建newElement下的节点
        XmlElement elid = xmlDoc.CreateElement("id");
        XmlElement elauthor = xmlDoc.CreateElement("author");
        XmlElement eltitle = xmlDoc.CreateElement("title");
        XmlElement elcontent = xmlDoc.CreateElement("content");
        elid.InnerText = ReturnCount();//这个方法有什么用
 public string ReturnCount()
    {
        //返回最后的ID值并+1
        string i = string.Empty;
        XmlDocument xmlDoc = new XmlDocument();
        xmlDoc.Load(Server.MapPath("XMLFile/XMLFile.xml"));
        XmlNode xmlNode = xmlDoc.DocumentElement.LastChild;
        if (xmlNode != null)
        {
            i = Convert.ToString(Convert.ToUInt32(xmlNode["id"].InnerText) + 1);
        }
        return i;
    }


 ReturnCount()方法有什么用?麻烦给出解释!
xml可是取代数据库吗?
用xml安全性怎么样?
听说有的网站整站都是用xml开发,有这么须要吗?

作者: shikun520   发布时间: 2010-08-17

什么时候用xml?是否有什么界限

作者: shikun520   发布时间: 2010-08-17