close

 

        using(XmlTextWriter writer = new XmlTextWriter(Server.MapPath(ResolveUrl("~/App_Data/test.xml")), System.Text.Encoding.UTF8)){
       
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 4;
            writer.WriteStartDocument(false);
            writer.WriteStartElement("root");          
            writer.WriteStartElement("item");
            writer.WriteAttributeString("id", "id_value");
            writer.WriteAttributeString("description", "description_value");
             writer.WriteAttributeString("parent", "parent_value");
             writer.WriteValue("value");
            writer.WriteEndElement();
           writer.WriteEndElement();
    }

 

參考網址

http://msdn.microsoft.com/zh-tw/library/z2w98a50(VS.80).aspx

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 wuminfajoy 的頭像
    wuminfajoy

    Fajoy的心情筆記

    wuminfajoy 發表在 痞客邦 留言(0) 人氣()