当前位置: 首页>>代码示例>>C#>>正文


C# Page.ParsePageXML方法代码示例

本文整理汇总了C#中DotNetWikiBot.Page.ParsePageXML方法的典型用法代码示例。如果您正苦于以下问题:C# Page.ParsePageXML方法的具体用法?C# Page.ParsePageXML怎么用?C# Page.ParsePageXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetWikiBot.Page的用法示例。


在下文中一共展示了Page.ParsePageXML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillAndLoadFromXMLDump

 /// <summary>Gets page titles and page text from local XML dump.
 /// This function consumes much resources.</summary>
 /// <param name="filePathName">The path to and name of the XML dump file as string.</param>
 public void FillAndLoadFromXMLDump(string filePathName)
 {
     Bot.LogEvent(Bot.Msg("Loading pages from XML dump..."));
     XmlReader reader = XmlReader.Create(filePathName);
     while (reader.ReadToFollowing("page")) {
         Page p = new Page(site, "");
         p.ParsePageXML(reader.ReadOuterXml());
         pages.Add(p);
     }
     reader.Close();
     Bot.LogEvent(Bot.Msg("XML dump loaded successfully."));
 }
开发者ID:wikigit,项目名称:Picasa-Review-Bot,代码行数:15,代码来源:DotNetWikiBot.cs

示例2: LoadEx

 /// <summary>Loads text and metadata for pages in PageList via XML export interface.
 /// Non-existent pages will be automatically removed from the PageList.
 /// Please, don't use this function when going to edit big amounts of pages on
 /// popular public wikis, as it compromises edit conflict detection. In that case,
 /// each page's text should be loaded individually right before its processing
 /// and saving.</summary>
 public void LoadEx()
 {
     if (IsEmpty())
         throw new WikiBotException(Bot.Msg("The PageList is empty. Nothing to load."));
     Bot.LogEvent(Bot.Msg("Loading {0} pages..."), pages.Count);
     string res = site.site + site.indexPath +
         "index.php?title=Special:Export&action=submit";
     string postData = "curonly=True&pages=";
     foreach (Page page in pages)
         postData += HttpUtility.UrlEncode(page.title) + "\r\n";
     XmlReader reader = XmlReader.Create(
         new StringReader(site.PostDataAndGetResultHTM(res, postData)));
     Clear();
     while (reader.ReadToFollowing("page")) {
         Page p = new Page(site, "");
         p.ParsePageXML(reader.ReadOuterXml());
         pages.Add(p);
     }
     reader.Close();
 }
开发者ID:wikigit,项目名称:Picasa-Review-Bot,代码行数:26,代码来源:DotNetWikiBot.cs

示例3: FillAndLoadFromXMLDump

        /// <summary>Gets page titles and page text from local XML dump.
        /// This function consumes much resources.</summary>
        /// <param name="filePathName">The path to and name of the XML dump file as string.</param>		
        public void FillAndLoadFromXMLDump(string filePathName)
        {
            Console.WriteLine("Loading pages from XML dump...");

            XmlReader reader = XmlReader.Create(filePathName);
            while (reader.ReadToFollowing("page")) {
                Page p = new Page(site, "");
                p.ParsePageXML(reader.ReadOuterXml());
                site.messages.pages.Add(p);
            }
            Console.WriteLine("XML dump loaded successfully.");
        }
开发者ID:BackupTheBerlios,项目名称:wikifighter-svn,代码行数:15,代码来源:DotNetWikiBot.cs


注:本文中的DotNetWikiBot.Page.ParsePageXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。