zoukankan      html  css  js  c++  java
  • asp.net Rss

    代码
            XmlWriterSettings ms = new XmlWriterSettings();
            ms.Indent 
    = true;
            XmlWriter xw 
    = XmlWriter.Create(Response.Output, ms);
            xw.WriteStartDocument();
            xw.WriteStartElement(
    "rss");
            xw.WriteAttributeString(
    "version","2.0");
            xw.WriteStartElement(
    "channel");
            xw.WriteElementString(
    "title","1111");
            xw.WriteElementString(
    "link""http://www.1111.com");
            xw.WriteElementString(
    "discription""1111");
            
    //////////填充的内容///////////
            xw.WriteStartElement("item");
            xw.WriteAttributeString(
    "shopid","1");

            xw.WriteStartElement(
    "shopname");
            xw.WriteCData(
    "商家1");
            xw.WriteEndElement();

            xw.WriteStartElement(
    "shoplink");
            xw.WriteString(
    "http://www.cqit.com.cn");
            xw.WriteEndElement();

            xw.WriteEndElement();
            
    /////////////End////////////////
            xw.WriteEndElement();
            xw.WriteEndElement();
            xw.WriteEndDocument();
            xw.Flush();
            xw.Close();

            Response.ContentType 
    = "text/xml";
            Response.Flush();
            Response.End();
  • 相关阅读:
    [BZOJ4553][TJOI2016&HEOI2016]序列
    树套树乱讲的代码
    树套树乱讲
    [Luogu4174][NOI2006]最大获益
    [BZOJ3879]SvT
    [BZOJ3611][HEOI2014]大工程
    [BZOJ1501][NOI2005]智慧珠游戏
    [BZOJ1499][NOI2005]瑰丽华尔兹
    [BZOJ3460] Jc的宿舍
    [HDU4812]D Tree
  • 原文地址:https://www.cnblogs.com/bobofsj11/p/1625750.html
Copyright © 2011-2022 走看看