﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Asp.NET 爱好者-最新评论</title><link>http://www.cnblogs.com/olay2008/CommentsRSS.aspx</link><description>olay2008的第二个家</description><language>zh-cn</language><pubDate>Wed, 26 Mar 2008 05:47:28 GMT</pubDate><lastBuildDate>Wed, 26 Mar 2008 05:47:28 GMT</lastBuildDate><generator>cnblogs</generator><item><title>Re:.net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/09/09/978890.html#1640698</link><dc:creator>弦影漂零</dc:creator><author>弦影漂零</author><pubDate>Wed, 09 Sep 2009 01:01:22 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/09/09/978890.html#1640698</guid><description><![CDATA[如果文章是html流的不是分不了了么？还有里面有可能有视频等东西怎么办？<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">弦影漂零</a> 2009-09-09 09:01 <a href="http://www.cnblogs.com/olay2008/archive/2009/09/09/978890.html#1640698#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492313</link><dc:creator>王昊_</dc:creator><author>王昊_</author><pubDate>Tue, 31 Mar 2009 08:26:59 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492313</guid><description><![CDATA[    //分页类 <br/>    public static string PageInfo(int count, string pageInfo, int pageList, int nowPage, string pageStr, string unit) <br/>{ <br/>    int pageCount = 1; <br/>    string temp = &quot; &lt;font color='red'&gt;&quot; + pageInfo + &quot;共有&quot; + count + unit + &quot; &lt;/font&gt;&amp;nbsp;&quot; + &quot;每页&quot; + pageList + unit + pageInfo; <br/>    if (count &gt; 0) <br/>    { <br/>        string firstPage = &quot;&quot;;//首页 <br/>        string lastPage = &quot;&quot;;//上一页 <br/>        string nextPage = &quot;&quot;;//下一页 <br/>        string endPage = &quot;&quot;;//未页 <br/>        pageCount = count / pageList; <br/>        string selectStr = &quot;跳转： &lt;select name='PageSelect' onchange='window.location.href=value' id='PageSelect'&gt;&quot;;//下拉单 <br/>        if ((count % pageList) &gt; 0) <br/>        { <br/>            pageCount++; <br/>        } <br/>        for (int i = 1; i &lt;= pageCount; i++) <br/>        { <br/>            if (i == nowPage) <br/>            { <br/>                selectStr += &quot; &lt;option selected='selected' value='&quot; + pageStr + &quot;page=&quot; + i + &quot;'&gt;&quot; + i + &quot; &lt;/option&gt;&quot;; <br/>            } <br/>            else <br/>            { <br/>                selectStr += &quot; &lt;option value='&quot; + pageStr + &quot;page=&quot; + i + &quot;'&gt;&quot; + i + &quot; &lt;/option&gt;&quot;; <br/>            } <br/>        } <br/>        selectStr += &quot; &lt;/select&gt;&quot;; <br/>        if (pageCount == 1) <br/>        { <br/>            firstPage = &quot; &lt;font color='#cccccc'&gt;首页 &lt;/font&gt;&quot;; <br/>            lastPage = &quot; &lt;font color='#cccccc'&gt;上一页 &lt;/font&gt;&quot;; <br/>            nextPage = &quot; &lt;font color='#cccccc'&gt;下一页 &lt;/font&gt;&quot;; <br/>            endPage = &quot; &lt;font color='#cccccc'&gt;尾页 &lt;/font&gt;&quot;; <br/>        } <br/>        else <br/>        { <br/>            if (nowPage == 1) <br/>            { <br/>                firstPage = &quot; &lt;font color='#cccccc'&gt;首页 &lt;/font&gt;&quot;; <br/>                lastPage = &quot; &lt;font color='#cccccc'&gt;上一页 &lt;/font&gt;&quot;; <br/>                nextPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + (nowPage + 1) + &quot;'&gt;下一页 &lt;/a&gt;&quot;; <br/>                endPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + pageCount + &quot;'&gt;尾页 &lt;/a&gt;&quot;; <br/>            } <br/>            else if (nowPage == pageCount) <br/>            { <br/>                firstPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=1'&gt;首页 &lt;/a&gt;&quot;; <br/>                lastPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + (pageCount - 1) + &quot;'&gt;上一页 &lt;/a&gt;&quot;; <br/>                nextPage = &quot; &lt;font color='#cccccc'&gt;下一页 &lt;/font&gt;&quot;; <br/>                endPage = &quot; &lt;font color='#cccccc'&gt;尾页 &lt;/font&gt;&quot;; <br/>            } <br/>            else <br/>            { <br/>                nextPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + (nowPage + 1) + &quot;'&gt;下一页 &lt;/a&gt;&quot;; <br/>                lastPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + (nowPage - 1) + &quot;'&gt;上一页 &lt;/a&gt;&quot;; <br/>                firstPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=1'&gt;首页 &lt;/a&gt;&quot;; <br/>                endPage = &quot; &lt;a href='&quot; + pageStr + &quot;page=&quot; + pageCount + &quot;'&gt;尾页 &lt;/a&gt;&quot;; <br/>            } <br/>        } <br/>        temp += &quot;&amp;nbsp;&amp;nbsp;&quot; + firstPage + &quot;&amp;nbsp;&amp;nbsp;&quot; + lastPage + &quot;&amp;nbsp;&amp;nbsp;&quot; + nextPage + &quot;&amp;nbsp;&amp;nbsp;&quot; + endPage + &quot;&amp;nbsp;&amp;nbsp;&quot; + selectStr; <br/>    } <br/>    else <br/>    { <br/>        temp = &quot;&quot;; <br/>    } <br/>    return temp; <br/>} <br/><br/><br/>    //复制  保存//实现代码 <br/>    public void test()<br/>    {<br/>        int page = 1;<br/>        if (Request.QueryString[&quot;page&quot;] != null)<br/>        {<br/>            page = Convert.ToInt32(Request.QueryString[&quot;page&quot;].Trim());<br/>        }<br/><br/>        int ArticleID = Convert.ToInt16(Request[&quot;ID&quot;]);<br/>        dr = MyclassDA.Index_Article_Show(ArticleID);  //SqlDataReader Index_Article_Show(int ID) 创建对象 <br/>        dr.Read();<br/><br/>        show1.InnerHtml = dr[&quot;Title&quot;].ToString();<br/>        string content = dr[&quot;Content&quot;].ToString();<br/>        ArrayList body = new ArrayList();<br/><br/>        string PageStr = &quot;a_read.aspx?id=&quot; + ArticleID + &quot;&amp;&quot;;<br/><br/>        if (content.IndexOf(&quot;{#NextPage#}&quot;) &gt; -1)//存在分页符号则分页 <br/>        {<br/>            //string[] tempList = content.Split(new string[] { &quot;{@Next@}&quot; }, StringSplitOptions.RemoveEmptyEntries);//String.Split 2.0新增特性 <br/>            //string[] tempList = SplitPage(content,&quot;{@Next@}&quot;);//内容分页 <br/>            string[] tempList = Regex.Split(content, &quot;{#NextPage#}&quot;, RegexOptions.IgnoreCase);<br/>            for (int i = 0; i &lt; tempList.Length; i++)<br/>            {<br/>                body.Add(tempList[i]);<br/>            }<br/><br/>        }<br/>        else<br/>        {<br/>            body.Add(content);//直接输出内容 <br/>        }<br/><br/>        if (page &lt; 1 || page &gt; body.Count)<br/>        {<br/>            page = 1;<br/>        }<br/><br/>        if (body.Count == 1)<br/>        {<br/>            l_content.InnerHtml = (string)body[0];<br/>        }<br/>        else<br/>        {<br/>            if (page &lt;= body.Count)<br/>            {<br/>                l_content.InnerHtml = (string)body[page - 1];<br/>            }<br/>            else<br/>            {<br/>                l_content.InnerHtml = (string)body[0];<br/>            }<br/>        }<br/><br/>        MyCutePage.InnerHtml = CommonClass.PageInfo(body.Count, &quot;新闻&quot;, 1, page, PageStr, &quot;篇&quot;);<br/><br/>        dr.Close();<br/>    }<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">王昊_</a> 2009-03-31 16:26 <a href="http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492313#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492311</link><dc:creator>王昊_</dc:creator><author>王昊_</author><pubDate>Tue, 31 Mar 2009 08:26:43 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492311</guid><description><![CDATA[路过的<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">王昊_</a> 2009-03-31 16:26 <a href="http://www.cnblogs.com/olay2008/archive/2009/03/31/978890.html#1492311#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/03/26/978890.html#1488512</link><dc:creator>duanxy</dc:creator><author>duanxy</author><pubDate>Thu, 26 Mar 2009 11:01:49 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/03/26/978890.html#1488512</guid><description><![CDATA[@Olay2008<br/>不行啊!!!!输出是System.Collections.Hashtable <br/>楼主解决下下,谢了<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">duanxy</a> 2009-03-26 19:01 <a href="http://www.cnblogs.com/olay2008/archive/2009/03/26/978890.html#1488512#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/03/03/978890.html#1466447</link><dc:creator>ziyouren</dc:creator><author>ziyouren</author><pubDate>Tue, 03 Mar 2009 07:14:03 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/03/03/978890.html#1466447</guid><description><![CDATA[同意楼上。<br/>你把调用方法给写出来啊。<br/>我这调试半天了。<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">ziyouren</a> 2009-03-03 15:14 <a href="http://www.cnblogs.com/olay2008/archive/2009/03/03/978890.html#1466447#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2009/02/16/978890.html#1452612</link><dc:creator>xiawei</dc:creator><author>xiawei</author><pubDate>Mon, 16 Feb 2009 07:56:13 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2009/02/16/978890.html#1452612</guid><description><![CDATA[你说你也真够缺德的,也不写完,也不说明白如何调用<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">xiawei</a> 2009-02-16 15:56 <a href="http://www.cnblogs.com/olay2008/archive/2009/02/16/978890.html#1452612#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2008/12/15/978890.html#1402757</link><dc:creator>眼子沙的马甲</dc:creator><author>眼子沙的马甲</author><pubDate>Mon, 15 Dec 2008 07:56:08 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2008/12/15/978890.html#1402757</guid><description><![CDATA[有html标记的怎么解决<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">眼子沙的马甲</a> 2008-12-15 15:56 <a href="http://www.cnblogs.com/olay2008/archive/2008/12/15/978890.html#1402757#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2008/11/18/978890.html#1373388</link><dc:creator>Olay2008</dc:creator><author>Olay2008</author><pubDate>Tue, 18 Nov 2008 05:02:49 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2008/11/18/978890.html#1373388</guid><description><![CDATA[<br/>调用方法：<br/>/// &lt;summary&gt;<br/>     /// 长内容分页 哈希表需要引用命名空间System.Collections <br/>     /// &lt;/summary&gt;<br/>     /// &lt;param name=&quot;n_content&quot;&gt;新闻内容&lt;/param&gt;<br/>     /// &lt;param name=&quot;page&quot;&gt;是新闻当前页数&lt;/param&gt;<br/>     /// &lt;param name=&quot;size&quot;&gt;每页显示字符长度&lt;/param&gt;<br/>     /// &lt;param name=&quot;linkurl&quot;&gt;页码链接地址&lt;/param&gt;<br/>     /// &lt;returns&gt;&lt;/returns&gt;<br/>SeparatePages(string n_content, string page, int size,string linkurl)<br/><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">Olay2008</a> 2008-11-18 13:02 <a href="http://www.cnblogs.com/olay2008/archive/2008/11/18/978890.html#1373388#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2008/10/30/978890.html#1356184</link><dc:creator>tianlai1008</dc:creator><author>tianlai1008</author><pubDate>Thu, 30 Oct 2008 07:24:25 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2008/10/30/978890.html#1356184</guid><description><![CDATA[引用之后出现<br/>System.Collections.Hashtable 是怎么回事,怎么用啊<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">tianlai1008</a> 2008-10-30 15:24 <a href="http://www.cnblogs.com/olay2008/archive/2008/10/30/978890.html#1356184#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: .net 文章分页</title><link>http://www.cnblogs.com/olay2008/archive/2008/08/17/978890.html#1289383</link><dc:creator>人</dc:creator><author>人</author><pubDate>Sun, 17 Aug 2008 03:30:17 GMT</pubDate><guid>http://www.cnblogs.com/olay2008/archive/2008/08/17/978890.html#1289383</guid><description><![CDATA[就是啊如何引用啊<br><br><div align=right><a style="text-decoration:none;" href="http://www.cnblogs.com/olay2008/" target="_blank">人</a> 2008-08-17 11:30 <a href="http://www.cnblogs.com/olay2008/archive/2008/08/17/978890.html#1289383#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>
