﻿<?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>博客园-kwklover</title><link>http://www.cnblogs.com/kwklover/</link><description /><language>zh-cn</language><lastBuildDate>Mon, 06 Jul 2009 07:50:50 GMT</lastBuildDate><pubDate>Mon, 06 Jul 2009 07:50:50 GMT</pubDate><ttl>60</ttl><item><title>Lucene 1.9 多目录搜索的的一个bug</title><link>http://www.cnblogs.com/kwklover/archive/2008/03/11/1100556.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Tue, 11 Mar 2008 06:41:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2008/03/11/1100556.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/1100556.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2008/03/11/1100556.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/1100556.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/1100556.html</trackback:ping><description><![CDATA[&nbsp;&nbsp; 这个问题解决有一段时间了。刚才在Lucene的群有朋友提问了这个问题。所以方便其他朋友遇到此问题时，好参考下。特贴出来<BR><BR>在需要搜索多个索引目录，多个字段的时候，发现有错误，提示的大概意思是(具体忘记了),关键词已经存在字典中。研究Lucene的源代码发现，是Lucene.net 1.9 rc1的一个bug : 
<P>具体代码在Lucene.Net.Search命名空间下的Query类的Combine method :</P>
<P>修改前的代码如下：</P>
<P>public virtual Query Combine(Query[] queries)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;System.Collections.Hashtable uniques = new System.Collections.Hashtable();<BR>&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; queries.Length; i++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Query query = queries[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;BooleanClause[] clauses = null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// check if we can split the query into clauses<BR>&nbsp;&nbsp;&nbsp;&nbsp;bool splittable = (query is BooleanQuery);<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (splittable)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BooleanQuery bq = (BooleanQuery) query;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;splittable = bq.IsCoordDisabled();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clauses = bq.GetClauses();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int j = 0; splittable &amp;&amp; j &lt; clauses.Length; j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;splittable = (clauses[j].GetOccur() == BooleanClause.Occur.SHOULD);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (splittable)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int j = 0; j &lt; clauses.Length; j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query tmp = clauses[j].GetQuery();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uniques.Add(tmp, tmp);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uniques.Add(query, query);<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;// optimization: if we have just one query, just return it<BR>&nbsp;&nbsp;&nbsp;if (uniques.Count == 1)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (Query) uniques.GetEnumerator().Current;<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;System.Collections.IEnumerator it = uniques.GetEnumerator();<BR>&nbsp;&nbsp;&nbsp;BooleanQuery result = new BooleanQuery(true);<BR>&nbsp;&nbsp;&nbsp;while (it.MoveNext())<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;result.Add((Query) it.Current, BooleanClause.Occur.SHOULD);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;return result;<BR>&nbsp;&nbsp;}</P>
<P>&nbsp;</P>
<P>修改后的代码(飘红的地方是更改过的)：</P>
<P>public virtual Query Combine(Query[] queries)<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;System.Collections.Hashtable uniques = new System.Collections.Hashtable();<BR>&nbsp;&nbsp;&nbsp;for (int i = 0; i &lt; queries.Length; i++)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;Query query = queries[i];<BR>&nbsp;&nbsp;&nbsp;&nbsp;BooleanClause[] clauses = null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;// check if we can split the query into clauses<BR>&nbsp;&nbsp;&nbsp;&nbsp;bool splittable = (query is BooleanQuery);<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (splittable)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BooleanQuery bq = (BooleanQuery) query;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;splittable = bq.IsCoordDisabled();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clauses = bq.GetClauses();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int j = 0; splittable &amp;&amp; j &lt; clauses.Length; j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;splittable = (clauses[j].GetOccur() == BooleanClause.Occur.SHOULD);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;if (splittable)<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (int j = 0; j &lt; clauses.Length; j++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Query tmp = clauses[j].GetQuery();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uniques.Add(tmp, tmp);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;else<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //uniques.Add(query, query);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=red>//modify by kwklover 2008/1/17 bug fixed for 防止加入多个重复的字典项<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (uniques.Contains(query) == false)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uniques.Add(query, query);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;// optimization: if we have just one query, just return it<BR>&nbsp;&nbsp;&nbsp;if (uniques.Count == 1)<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //return (Query) uniques.GetEnumerator().Current;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=red> //modify by kwklover 2008/1/17<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Collections.IDictionaryEnumerator iter = uniques.GetEnumerator();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iter.MoveNext();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return iter.Value as Query;</FONT><BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;System.Collections.IEnumerator it = uniques.GetEnumerator();<BR>&nbsp;&nbsp;&nbsp;BooleanQuery result = new BooleanQuery(true);<BR>&nbsp;&nbsp;&nbsp;while (it.MoveNext())<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;result.Add((Query) it.Current, BooleanClause.Occur.SHOULD);<BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;return result;<BR>&nbsp;&nbsp;}</P>
<P>&nbsp;</P>
<P>另外在Lucene 2.0版已经修复了此问题。不过Lucene 2.0 和 Lucene 1.9的 API有比较大的变化</P><img src ="http://www.cnblogs.com/kwklover/aggbug/1100556.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/48002/" target="_blank">竞争日趋激烈 微软欲借 Windows 7 扭转战局</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>众里寻他千百度，蓦然回首，那人却在灯火阑珊处</title><link>http://www.cnblogs.com/kwklover/archive/2008/02/04/1064639.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 04 Feb 2008 15:31:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2008/02/04/1064639.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/1064639.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2008/02/04/1064639.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/1064639.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/1064639.html</trackback:ping><description><![CDATA[<P><FONT size=2>有时候 ，经常搜索一些关于搜索引擎的技术文章，时有文章提到，基于网页库，基于模板的spider的说法，这些概念对于没有在专业搜索引擎公司工作经历的我来说，实在不好理解，联系到好久以前看到腾讯招聘“搜索引擎编辑”的要求，有两条比较有趣：<BR><BR>工作职责：<BR>&nbsp;&nbsp;&nbsp; 1,制作定向采集模版<BR>&nbsp;&nbsp;&nbsp;&nbsp;2 ......... n<BR>工作要求：<BR>&nbsp;&nbsp;&nbsp; 1,熟悉计算机操作，熟练掌握OFFICE软件，能够很快学会xml,html基本语法<BR>&nbsp;&nbsp;&nbsp; 2,其他均和计算机/编程不相关<BR><BR>从这个招聘上看，腾讯的定向采集模版应该是很容易制作的。所以一直很想知道这个模版是如何制作的，后台如何和模板结合完成数据采集任务的。可惜，到目前也不得而知，看来自己摸索吧。<BR>&nbsp;<BR>前端时间，为了做一个网站，需要开发一个CMS，而CMS最常见，最简单的应该就是“网页模板”了，CMS的模板处理原理本质是“数据替换”。反过来想，定向信息采集的“采集模板”的处理本质是“数据抽取”，以此思路展开，我自己设计了第一个“采集模板”：<BR>&lt;html&gt;<BR>&nbsp;&nbsp; &lt;title&gt;{spider:文章标题}&lt;/title&gt;<BR>&nbsp;&nbsp; &lt;body&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div&gt;发布日期：{spider:发布日期} 作者：{spider:文章作者}&lt;/div&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;div&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {spider:文章内容}<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<BR>&nbsp;&nbsp; &lt;/body&gt;<BR>&lt;/html&gt;<BR>感觉上就像CMS的模板，里面由{}包含的项就是标签，对于CMS而言，是替换标签，而对于数据采集来说，则是抽取标签。<BR>当然了，对于复杂的采集任务，简单的抽取标签是不够的，还需要一套“数据抽取模板语言”，就好比如CMS的模板语言一样。<BR><BR>经过初步的实验，通过html parser和正则表达式可以实现简单网页的定向信息抽取的任务。<BR><BR>在摸索的过程中，对于老早就想实现的“网页局部切割监视”技术，竟然也有了豁然开朗的感觉。<BR><BR>所以就有了“众里寻他千百度，蓦然回首，那人却在灯火阑珊处”的感觉。<BR>虽然不是什么了不起的东西，甚至对于大家来说，是小儿科了。不过在技术探索的过程，发现新东西，总是令人兴奋的!<BR><BR>&nbsp;<BR>快过年了 ,&nbsp; 祝贺所有的兄弟姐妹 ，也祝贺自己，新年快乐！</FONT></P><img src ="http://www.cnblogs.com/kwklover/aggbug/1064639.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/48001/" target="_blank">上海电信计划2012年80%用户实现100M带宽</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>问题总结：判断MS SQLSERVER临时表是否存在</title><link>http://www.cnblogs.com/kwklover/archive/2007/11/23/969633.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 23 Nov 2007 02:48:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/11/23/969633.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/969633.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/11/23/969633.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/969633.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/969633.html</trackback:ping><description><![CDATA[<FONT size=2>&nbsp;drop table&nbsp;&nbsp;#tempcitys<BR>&nbsp;select * into #tempcitys from hy_citys<BR><BR>上面的语句第一次运行的时候就肯定出错了,但第二次就不会。<BR>因为select * into #tempcitys from hy_citys自动创建了临时表#tempcitys ，第一次临时表不存在，drop table自然就出错了。<BR>刚开始没反应过来，select * into是会自动创建临时表的。<BR><BR>所以比较可靠的做法，还是先判断临时表是否存在，然后再drop table<BR>if exists (select * from tempdb.dbo.sysobjects where id = object_id(N'tempdb..#tempcitys') and type='U')<BR>&nbsp;&nbsp; drop table #tempcitys<BR><BR>注意tempdb后面是两个. 不是一个的<BR><BR>考虑另外一种SQL的写法<BR>insert into #tempcitys(cityid) select cityid from hy_citys<BR>这种写法，#tempcitys则不会被自动创建，要使用#tempcitys，则需要先create table #tempcitys(cityid int)<BR><BR>原来我是搞混了。学艺不精的结果。：（</FONT><img src ="http://www.cnblogs.com/kwklover/aggbug/969633.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/48000/" target="_blank">数万名网友签名抗议星际争霸2取消局域网功能</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>小技巧：处理ASP提交的参数是经过GB2312 URL编码的</title><link>http://www.cnblogs.com/kwklover/archive/2007/10/10/919759.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Wed, 10 Oct 2007 08:21:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/10/10/919759.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/919759.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/10/10/919759.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/919759.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/919759.html</trackback:ping><description><![CDATA[&nbsp; 最近在一个地方的门户网站，基于PDO规范整合了动易，网人分类信息，OBlog，Discuz!NT论坛，可是在整合动易和DNT的时候，在中文用户名字的处理上出现了编码问题。动易是GB2312的，而DNT是UTF-8的，虽然也可以把DNT转成GB2312的，不过显然不是一个好的方案。论坛上各式各样的文字都有，很容易出现乱码问题。幸好在河源同行告诉我他写的一个帖子：<A href="http://nt.discuz.net/showtopic.aspx?page=end&amp;topicid=30804#222106">处理ASP提交的参数是经过GB2312 URL编码的</A><BR>还不错。转一下以备忘：<BR><BR><FONT color=#0000ff size=2>最近做ASP 整合Discuz!NT ASP是gb2312编码的 而DZNT是 utf-8 的<BR>修改&lt;globalization requestEncoding="gb2312" resp/&gt; 不是很实际<BR>最终找到解决方案<BR><BR>'引用System.Collections.Specialized和System.Text命名空间<BR><BR>&nbsp; NameValueCollection gb2312Requests;<BR>&nbsp; gb2312Requests = HttpUtility.ParseQueryString(Request.Url.Query, Encoding.GetEncoding("GB2312"))<BR>&nbsp; Response.Write(gb2312Requests["string"]);&nbsp; //'里面的string就是你提交的参数的Key</FONT> <BR><BR><BR>不过编码问题虽然解决了。不过asp和asp.net用MD5加密中文不一致的问题，到现在还没有办法解决。从这个角度上来，PDO规范基本不适合用于跨开发平台的系统整合，只能在asp占点小天地。虽然整合起来很方便快捷。但熟悉了PDO规范也就很容易知道。PDO实在是垃圾。有分布却无事务保证，系统之间依赖太大。<BR><BR>测试了下，PHP5和ASP.NET的MD5加密中文倒是可以一致，看来V2要淘汰ASP的系统了。SSO方案也要重写了<BR><BR>好久没更新自己的blog了。胡扯一下。<img src ="http://www.cnblogs.com/kwklover/aggbug/919759.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47999/" target="_blank">Silverlight打造杰克逊纪念专题</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Lucene.net实现自定义排序笔记</title><link>http://www.cnblogs.com/kwklover/archive/2007/07/28/834819.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 28 Jul 2007 09:21:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/07/28/834819.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/834819.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/07/28/834819.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/834819.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/834819.html</trackback:ping><description><![CDATA[<P>在Lucene.net实现自定义排序，需要实现两个Lucene.Net.Search的两个接口：<BR>public interface SortComparatorSource<BR>{<BR>&nbsp;&nbsp; ScoreDocComparator NewComparator(IndexReader reader , System.String fieldname) ;<BR>}</P>
<P>public interface ScoreDocComparator<BR>{<BR>&nbsp;&nbsp; int Compare(ScoreDoc i , ScoreDoc j) ;<BR>&nbsp;&nbsp; System.IComparable SortValue(ScoreDoc i) ;<BR>&nbsp;&nbsp; int SortType() ;<BR>}</P>
<P>涉及到的一个类：<BR>public class ScoreDoc<BR>{<BR>&nbsp;&nbsp; public float score ;<BR>&nbsp;&nbsp; public int doc ;<BR>&nbsp;&nbsp; public ScoreDoc(int doc , float score)<BR>&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.doc = doc ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.score = score ;<BR>&nbsp;&nbsp; }<BR>}</P>
<P>Lucene.net 2.0包含的SortType有：<BR>在Lucene.Net.Search.SortField里定义的：<BR>public class SortField<BR>{<BR>&nbsp;&nbsp; public const int SCORE = 0 ;&nbsp; //相关度<BR>&nbsp;&nbsp; public const int DOC = 1 ;&nbsp;&nbsp;&nbsp; //文挡号<BR>&nbsp;&nbsp; public const int AUTO = 2 ;&nbsp;&nbsp; //自动识别<BR>&nbsp;&nbsp; public const int STRING = 3 ; //字符型<BR>&nbsp;&nbsp; public const int INT = 4 ;&nbsp;&nbsp;&nbsp; //int<BR>&nbsp;&nbsp; public const int FLOAT = 5 ;&nbsp; //float<BR>&nbsp;&nbsp; public const int CUSTOM = 9 ; //自定义<BR>&nbsp;&nbsp; .....<BR>}</P>
<P>少了DateTime,那就实现DateTime类型的自定义排序来测试下：<BR>Lucene.Net.Search.ScoreDocComparator接口的实现类:<BR>&nbsp;&nbsp;&nbsp; public class DateDocComparator : Lucene.Net.Search.ScoreDocComparator <BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private string fieldname = null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private System.IComparable[] cachedValues ;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public DateDocComparator(System.IComparable[] cachedValues, string fieldname)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.cachedValues = cachedValues;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.fieldname = string.Intern(fieldname) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public int Compare(ScoreDoc i, ScoreDoc j)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.cachedValues[i.doc].CompareTo(this.cachedValues[j.doc]) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public System.IComparable SortValue(ScoreDoc i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.cachedValues[i.doc] ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public int SortType()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return Lucene.Net.Search.SortField.CUSTOM ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>Lucene.Net.Search.SortComparatorSource接口的实现类:<BR>&nbsp;&nbsp;&nbsp; public class DateSortComparatorSource : Lucene.Net.Search.SortComparatorSource<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ScoreDocComparator NewComparator(Lucene.Net.Index.IndexReader reader, System.String field)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new DateDocComparator(GetCustom(reader, field), field);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected virtual System.IComparable[] GetCustom(Lucene.Net.Index.IndexReader reader, System.String field)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IComparable[] retArray = new System.IComparable[reader.MaxDoc()];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lucene.Net.Index.TermDocs termDocs = reader.TermDocs();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lucene.Net.Index.TermEnum termEnum = reader.Terms(new Lucene.Net.Index.Term(field, ""));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Lucene.Net.Index.Term term = termEnum.Term();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (term == null || term.Field() != field)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.IComparable termval = Lucene.Net.Documents.DateTools.StringToDate(term.Text()) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; termDocs.Seek(termEnum);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (termDocs.Next())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; retArray[termDocs.Doc()] = termval;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (termEnum.Next());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finally<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; termDocs.Close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; termEnum.Close();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return retArray;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }</P>
<P>使用：<BR>Sort sort = new Sort(new SortField("datecreated",new DateSortComparatorSource(),true)) ;<BR></P><img src ="http://www.cnblogs.com/kwklover/aggbug/834819.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47998/" target="_blank">传诺基亚正在开发Android手机</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>模版引擎AderTemplate源代码分析笔记</title><link>http://www.cnblogs.com/kwklover/archive/2007/07/12/815509.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Thu, 12 Jul 2007 06:37:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/07/12/815509.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/815509.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/07/12/815509.html#Feedback</comments><slash:comments>15</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/815509.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/815509.html</trackback:ping><description><![CDATA[摘要: AderTemplate是一个小型的模板引擎。无论是拿来直接使用还是用来研究模板引擎实现方式，都是一个不错的选择。本文尝试对其源代码做一些分析。&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/07/12/815509.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/815509.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47996/" target="_blank">7月编程语言排行榜</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>T-SQL复习总结--用T-SQL创建，修改，管理，删除数据库</title><link>http://www.cnblogs.com/kwklover/archive/2007/05/11/743485.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 11 May 2007 15:26:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/05/11/743485.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/743485.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/05/11/743485.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/743485.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/743485.html</trackback:ping><description><![CDATA[摘要: T-SQL复习总结(1)--用T-SQL创建，修改，管理，删除数据库&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/05/11/743485.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/743485.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47995/" target="_blank">Google Voice 上手</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>面向搜索的中文分词设计</title><link>http://www.cnblogs.com/kwklover/archive/2007/03/19/679425.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 19 Mar 2007 01:47:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/03/19/679425.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/679425.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/03/19/679425.html#Feedback</comments><slash:comments>18</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/679425.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/679425.html</trackback:ping><description><![CDATA[<P><A href="/kwklover/archive/2007/03/19/679327.html"><FONT size=2>我开发的中文分词程序，开源发布</FONT></A><FONT size=2>&nbsp;,其实哪个中文分词的整体架构是比较糟糕的。架构是否优秀决定了很多构思无法实现，思考了比较久，最近准备开发第二版，抛弃以前的架构，重新实现。下面是一些设计和构思。计划是两周时间开发完成beta版(如果因为工作关系，也有可能放弃),主要是希望和大家交流下设计思想，我觉得构思很重要，想得实现不了，可以慢慢研究，想不到才是头大的问题，希望能和大家一起交流下：<BR><BR>新版中文分词构想(面向搜索)：</FONT></P>
<P><FONT size=2>分解流程：<BR>1，分段，根据基本的分隔符号对文本进行分段，比如，。；！!,; \r\n等分解文本<BR>2，分字符区，即分解成纯粹的 中文文本区 ，数字区 ，综合字符区(包括英文，数字或者其他符号)，分割符号区<BR>3，对中文文本区调用中文分词算法，对数字区区按空格分词，对综合字符区调用英文分词算法,分割符号区保留<BR>4，对初步分解的单字中文进行中文姓名识别。<BR>5，结合前后词，对单字中文和数字做日期识别分析<BR>6，未登陆词分析与识别</FONT></P>
<P><FONT size=2>算法构想：<BR>1，中文分词算法<BR>&nbsp; 匹配模式：正向最大化，反向最大化，概率最大化<BR>&nbsp; 也会考虑参考SharpICTCLAS系统的NShortpath分词算法(不过目前还没看懂，迟钝的很)<BR>&nbsp; <BR>2，中文姓名识别算法<BR>&nbsp; 主要根据中文姓，加上初步分解出的单字中文进行分析：基于词库分析单字中文作为名的概率。<BR>&nbsp;<BR>3，日期识别算法<BR>&nbsp; 将分解出的单字中文结合前后字符，判断是否为以下格式之一：<BR>&nbsp; 数字+年+数字+月+数字+日<BR>&nbsp; 数字+年+数字+月<BR>&nbsp; 数字+月+数字+日<BR>&nbsp; 数字+月<BR>&nbsp; 数字+日<BR>&nbsp;<BR>4，新词识别(未登陆词识别)<BR>&nbsp; 1，将分解出的单字中文判断排除常用单词(StopWords)外,作为单字出现的概率。所以需要一个单字字库，包括单字出现概率的信息。<BR>&nbsp; 当然也可以将现有词库对词进行分解成单字概率分布模型库(具体如何设计还没考虑好)，提出来和大家交流下：<BR>&nbsp; 单字出现在第一个字符概率 出现在中间的概率 出现在尾部的概率<BR>&nbsp; <BR>&nbsp; 2，将上叙分析的新词进行概率分析，比如在全文中出现超过N次(比如2次，次数越大，作为一个词的可能性越高)，以提高新词识别的准确度；<BR>&nbsp; 不过如此大动作的分析，性能估计有很大问题。<BR>&nbsp; <BR>5，英文分词算法<BR>&nbsp; 1，将全部字符处理为半角字符。<BR>&nbsp; 2，将全部字符处理为小写字符。<BR>&nbsp; 3，识别各种英文字符格式，比如电子邮件格式，网址格式等等。(用正则表达式)<BR>&nbsp; 4，处理英文形式问题：比如将所有英文复数形式转换成单数形式。将各种简写形式处理为同一形式等等(这部分有兴趣可以参考dotlucene和snowball.net对英文处理的方式，这个部分我也没有深入研究过。)<BR></FONT></P>
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/679425.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47994/" target="_blank">Google号召社区力量为互联网加速</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>我开发的中文分词程序，开源发布</title><link>http://www.cnblogs.com/kwklover/archive/2007/03/19/679327.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 18 Mar 2007 22:14:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/03/19/679327.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/679327.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/03/19/679327.html#Feedback</comments><slash:comments>23</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/679327.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/679327.html</trackback:ping><description><![CDATA[功能介绍：请参看<A class=postTitle2 id=viewpost1_TitleUrl href="/kwklover/archive/2007/02/12/647929.html"><FONT color=#56b6e9>花2周时间开发的中文分词终于有点小样了</FONT></A>&nbsp;(有些功能没体现出来)<BR>本中文分词是基于匹配模式开发的中文分词程序，为本人练手作品。也可以直接使用。但不建议。因为整体架构有一些基础性问题。不过做为开发中文分词的参考，相信还是有一定价值的。<BR>最近<A id=AjaxHolder_Comments_CommentList_ctl04_NameLink href="http://zhenyulu.cnblogs.com/" target=_blank><FONT color=#000080>吕震宇</FONT></A>老师发布了ICTCLAS的C#版<A id=viewpost1_TitleUrl href="/zhenyulu/category/85598.html"><FONT color=#000080>SharpICTCLAS</FONT></A>。很优秀的中文分词程序。我的这个和它根本不是一个级别的。不过在自己的应用中，估计还是不能直接拿<A id=viewpost1_TitleUrl href="/zhenyulu/category/85598.html"><FONT color=#000080>SharpICTCLAS</FONT></A>就用。因为现在中文分词不仅仅关注准确性了，而更多考虑应用的问题了,比如(以下提的例子仅仅为交流而已，希望你在交流的范围进行思考。不存在褒贬什么的含义)：<BR>1，全角识别和处理问题<BR>例子：SＵN开放了Java源代码<BR>分析：如果能识别SＵN有全角字符，而且也正确识别SＵN为一个字符，但是从搜索的角度来看。似乎需要把所有形式处理为一种形式sun,当然这也可以看成是属于Lucene的Analyzer的问题<BR><BR>2，英文识别和处理的问题<BR>例子：U.S.A是美国的的英文简称<BR>分析：在<A id=viewpost1_TitleUrl href="/zhenyulu/category/85598.html"><FONT color=#000080>SharpICTCLAS</FONT></A>中会把U.S.A分成6个字符。估计<A id=viewpost1_TitleUrl href="/zhenyulu/category/85598.html"><FONT color=#000080>SharpICTCLAS</FONT></A>的英文处理还是比较弱，毕竟是免费版的。<BR><BR>3,专业术语和特殊字符识别和处理问题<BR>比如asp.net是分成asp/./net还是分成asp.net好？<A href="mailto:test@test.com">test@test.com</A>是做为一个词还是分开等等。<BR><BR>中文的例子就不举了。<A id=viewpost1_TitleUrl href="/zhenyulu/category/85598.html"><FONT color=#000080>SharpICTCLAS</FONT></A>对纯中文的分词是非常优秀的。<BR>其实我提出上面的问题，是想表达一个观点，没有最好的中文分词。只有最符合应用的中文分词,所以最好的中文分词应该是你自己根据需求定制开发的。希望我的这个中文分词程序(虽然还是比较烂的<IMG height=19 src="http://www.cnblogs.com/Emoticons/71_71.gif" width=19 border=0>)能够为你提供一些参考。那怕是一点点。<BR>架构(类关系图)<BR><BR><IMG height=512 alt=中文分词v1类关系图.gif src="http://www.cnblogs.com/images/cnblogs_com/kwklover/中文分词v1类关系图.gif" width=604 border=0><BR><BR><A href="/Files/kwklover/OpenCNSegmenter.rar">download source code</A><BR>
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/679327.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47994/" target="_blank">Google号召社区力量为互联网加速</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>小总结：DotLucene如何才能快速生成索引?</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/26/631065.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 26 Jan 2007 04:15:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/26/631065.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/631065.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/26/631065.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/631065.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/631065.html</trackback:ping><description><![CDATA[&nbsp;&nbsp; DotLucene生成索引的速度的是个大问题。不过我通常是想法比技术多。所以除了常规的性能调整外。更重要的是通过尝试不同的做法来测试其索引的速度：<BR>&nbsp; 1，一般做法：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 通过调整maxMergeDocs,mergeFactor,minMergeDocs参数来达到性能优化。另外也可以通过先索引到内存，然后倒入文件索引的方式。具体就不说。网上资料很多。<BR><BR>&nbsp; 2，小数据多批次索引：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 我在做一个生成索引的测试的时候。刚开始一次性2W多条数据来做索引。X慢N久才完成。才1W多而已啊。后来，我每次从数据库读100-300条数据批次做索引。我靠，竟然几分种就搞完2W多条数据拉。<img src ="http://www.cnblogs.com/kwklover/aggbug/631065.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47989/" target="_blank">Twitter无处不在 魔兽世界Twitter发送器插件发布</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>小总结：如何表达用户是否禁止的概念 ？</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/26/631056.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 26 Jan 2007 04:05:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/26/631056.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/631056.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/26/631056.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/631056.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/631056.html</trackback:ping><description><![CDATA[<STRONG>&nbsp;1,在数据库表填加一个IsFobidden字段。表示是否禁止；<BR>&nbsp;2,在数据库填加两个字段：开始时间和结束时间；通过设置一个远低下现在的时间表示禁止</STRONG><BR>&nbsp;你通常都采用那种表达方式？<BR>&nbsp;用户系统的三个方面：有效时间范围。是否禁用。可以做什么。<BR>&nbsp;第一种显然漏掉了有效时间范围；<BR>&nbsp;所以第二种是较优的方案，因为它可以同时表达两种含义：<BR>&nbsp;帐号的有效时间范围和是否禁用的概念；而至于用户能干什么，那是权限系统的问题。 这样加上权限系统刚好完整表达了用户系统的三个方面<BR>&nbsp;这个是在任何系统设计都需要考虑，即使客户没有这样的要求。<img src ="http://www.cnblogs.com/kwklover/aggbug/631056.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47989/" target="_blank">Twitter无处不在 魔兽世界Twitter发送器插件发布</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Web Spider提取编码方法总结</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/24/628501.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Wed, 24 Jan 2007 00:04:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/24/628501.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/628501.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/24/628501.html#Feedback</comments><slash:comments>12</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/628501.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/628501.html</trackback:ping><description><![CDATA[摘要: 本文总结了Web Spider提取编码的四种方法<br>1，通过分析Header提取编码<br>2，通过分析BOM(Byte Order Mark)提取编码<br>3，通过分析页面的meta提取编码<br>4，通过字节流分析检测编码&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/24/628501.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/628501.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47988/" target="_blank">Firefox 3.5匆忙推出漏洞多 Mozilla本月将更新</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>WebSpider的编码问题(乱码)浅析</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/22/627173.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 22 Jan 2007 09:22:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/22/627173.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/627173.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/22/627173.html#Feedback</comments><slash:comments>17</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/627173.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/627173.html</trackback:ping><description><![CDATA[<P><FONT size=2>这两天看到几篇关于WebSpider的文章。其中关于抓取网页出现的编码格式问题大家都比较感兴趣，以前在参与帮看网</FONT><FONT size=2>的开发时也遇到过。不过那时候忙于ITDB的</FONT><A href="http://bbs.itdb.cn"><FONT size=2>BBS</FONT></A><FONT size=2>开发，没有时间去研究。今天看到</FONT><A class=singleposttitle id=viewpost1_TitleUrl href="/xuanfeng/archive/2007/01/21/626296.html"><FONT size=2>解决网爬工具爬取页面信息出现乱码的问题</FONT></A><FONT size=2> ,刚好最近离职赋闲在家。所以又挑起了我研究学习的兴趣。现在把我的“研究成果”和大家探讨下：<BR>&nbsp; 下面我按照我解决问题的思路来行文<BR>&nbsp;&nbsp; 1，要根本解决编码问题，先要从编码的理论入手。<BR>&nbsp;&nbsp; 2，计算机是一门实践的科学，多动手尝试吧。</FONT></P>
<P><FONT size=2>一，和编码相关的理论知识：<BR>&nbsp; </FONT><A href="http://onebird.nklog.org/post/2006/08/24/accc1_ii_ccace"><FONT size=2>中文编码处理(1) －－ 编码与字符集</FONT></A><FONT size=2>，我摘录几句：<BR>&nbsp; 如果我们读不同编码的文件 到程序内部处理再保存程另一个文件 涉及到三次编码问题<BR>&nbsp; 1 读入文件使用什么编码<BR>&nbsp; 2 程序中使用什么编码<BR>&nbsp; 3 写出文件使用什么编码<BR>&nbsp; 看到这里。可以知道如果自以为先用某种格式把数据从流中读取出来，然后判断，再转换的方式处理编码问题，那么方法本身就错了。结果自然就是不可预期的。当然上面的话并不代表权威。仅仅做为一种分析的参考。</FONT></P>
<P><FONT size=2>二，http协议和html的规范关于如何得到一个页面的字符编码三种方法：<BR>1.An HTTP "charset" parameter in a "Content-Type" field. <BR>example:<BR>Content-Type: text/html; charset=EUC-JP</FONT></P>
<P><FONT size=2>2.A META declaration with "http-equiv" set to "Content-Type" and a value set for "charset". <BR>example:<BR>&lt;META http-equiv="Content-Type" content="text/html; charset=EUC-JP"&gt;</FONT></P>
<P><FONT size=2>3.The charset attribute set on an element that designates an external resource. <BR>example:<BR>&lt;A href="</FONT><A href="http://www.w3.org/"><FONT size=2>http://www.w3.org/</FONT></A><FONT size=2>" charset="ISO-8859-1"&gt;W3C Web site&lt;/A&gt;</FONT></P>
<P><FONT size=2>&nbsp; 现在先贴一段常见的抓取网页的代码，方便后续的讨论：</FONT></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">WebRequest&nbsp;webRequest&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;WebRequest.Create(url);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>WebResponse&nbsp;webResponse&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;webRequest.GetResponse();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;Stream&nbsp;stream&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;webResponse.GetResponseStream();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;StreamReader&nbsp;sr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;StreamReader(stream,&nbsp;Encoding.Default);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;html&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;sr.ReadToEnd();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;html;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></FONT></SPAN></DIV>
<P><FONT size=2>常见的识别编码格式都是要么从HttpWebResponse的ContentEncoding和CharacterSet去分析，要么从提取的网页里的分析(二列出的三种方法)，现在的问题就出在既然HttpWebResponse的ContentEncoding和CharacterSet并不可靠。而要从流读数据必须指定编码，但现在并不能可靠的确定数据源的正确编码，而尝试用一种编码格式读然后转又会遭遇上叙一所说的问题。这让我想起了我以前写过的“</FONT><A href="/kwklover/archive/2006/04/02/364614.html"><FONT size=2>由一道面试题引起的疑问与思考</FONT></A><FONT size=2>”里关于XML编码格式问题，里面谈到BOM(字节顺序标记)的问题,转其中的几句话：<BR>&nbsp;W3C定义了三条XML解析器如何正确读取XML文件的编码的规则：<BR>&nbsp;1，如果文挡有BOM(字节顺序标记，一般来说，如果保存为unicode格式，则包含BOM，ANSI则无)，就定义了文件编码<BR>&nbsp;2，如果没有BOM，就查看XML声明的编码属性<BR>&nbsp;3，如果上述两个都没有，就假定XML文挡采用UTF-8编码</FONT></P>
<P><FONT size=2>其实网页也是一种文本格式的东西，其规则也应该类似，我搜索了下，找到更详细的资料：<BR>&nbsp;1,如果流中是以0xef, 0xbb, 0xbf开头的话，可以确定编码格式utf-8的<BR>&nbsp;2,如果流中是以0xff,0xfe开头的话，可以确定编码格式是utf-16的</FONT></P>
<P><FONT size=2>如果仅仅按照上面所列两种情况去判断的，还显然不够严谨，但是到目前为止，我还没找到更详细的关于各种编码的BOM的更多资料。<BR>写到这里，我不得不告诉你，上面的一切探索对于.net来说都是徒劳的，因为.net已经内置了这样的判断方法：<BR>&nbsp; StreamReader sr = new StreamReader(stream, Encoding.Default,true);<BR>就多加一个true,ms帮你完成BOM的检测。具体的你可以看MSDN的帮助文挡。</FONT></P>
<P><FONT size=2>我在开篇说到计算机是一门实践的科学，我测试了几个网页都没发现乱码问题。当然这并不表示就完全没有问题，只是一时没找到让它乱码的网页，如果你发现了，请你一定要告诉我。我们一起来研究下。</FONT></P>
<P><FONT size=2>最后，我想推翻我刚才的结论：上面的一切探索对于.net来说都是徒劳的；因为我看到下面的代码的时候，我知道why,而不仅仅是how ！<BR>Reflector出来的StreamReader关于通过BOM检测编码格式的代码：<BR></FONT><FONT size=2><STRONG></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Code_Closed_Image_172508 onclick="this.style.display='none'; Code_Closed_Text_172508.style.display='none'; Code_Open_Image_172508.style.display='inline'; Code_Open_Text_172508.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><IMG id=Code_Open_Image_172508 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_172508.style.display='none'; Code_Closed_Image_172508.style.display='inline'; Code_Closed_Text_172508.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><SPAN id=Code_Closed_Text_172508 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">DetectEncoding</SPAN><SPAN id=Code_Open_Text_172508 style="DISPLAY: none"><BR><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;DetectEncoding()<BR><IMG id=Codehighlighter1_38_2126_Open_Image onclick="this.style.display='none'; Codehighlighter1_38_2126_Open_Text.style.display='none'; Codehighlighter1_38_2126_Closed_Image.style.display='inline'; Codehighlighter1_38_2126_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_38_2126_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_38_2126_Closed_Text.style.display='none'; Codehighlighter1_38_2126_Open_Image.style.display='inline'; Codehighlighter1_38_2126_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_38_2126_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_38_2126_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteLen&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_87_2116_Open_Image onclick="this.style.display='none'; Codehighlighter1_87_2116_Open_Text.style.display='none'; Codehighlighter1_87_2116_Closed_Image.style.display='inline'; Codehighlighter1_87_2116_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_87_2116_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_87_2116_Closed_Text.style.display='none'; Codehighlighter1_87_2116_Open_Image.style.display='inline'; Codehighlighter1_87_2116_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_87_2116_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_87_2116_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">._detectEncoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;flag1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xfe</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xff</SPAN><SPAN style="COLOR: #000000">))<BR><IMG id=Codehighlighter1_269_434_Open_Image onclick="this.style.display='none'; Codehighlighter1_269_434_Open_Text.style.display='none'; Codehighlighter1_269_434_Closed_Image.style.display='inline'; Codehighlighter1_269_434_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_269_434_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_269_434_Closed_Text.style.display='none'; Codehighlighter1_269_434_Open_Image.style.display='inline'; Codehighlighter1_269_434_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_269_434_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_269_434_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;UnicodeEncoding(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.CompressBuffer(</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xff</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xfe</SPAN><SPAN style="COLOR: #000000">))<BR><IMG id=Codehighlighter1_539_1051_Open_Image onclick="this.style.display='none'; Codehighlighter1_539_1051_Open_Text.style.display='none'; Codehighlighter1_539_1051_Closed_Image.style.display='inline'; Codehighlighter1_539_1051_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_539_1051_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_539_1051_Closed_Text.style.display='none'; Codehighlighter1_539_1051_Open_Image.style.display='inline'; Codehighlighter1_539_1051_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_539_1051_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_539_1051_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteLen&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">))&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">))<BR><IMG id=Codehighlighter1_666_808_Open_Image onclick="this.style.display='none'; Codehighlighter1_666_808_Open_Text.style.display='none'; Codehighlighter1_666_808_Closed_Image.style.display='inline'; Codehighlighter1_666_808_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_666_808_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_666_808_Closed_Text.style.display='none'; Codehighlighter1_666_808_Open_Image.style.display='inline'; Codehighlighter1_666_808_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_666_808_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_666_808_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;UTF32Encoding(</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.CompressBuffer(</SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_855_999_Open_Image onclick="this.style.display='none'; Codehighlighter1_855_999_Open_Text.style.display='none'; Codehighlighter1_855_999_Closed_Image.style.display='inline'; Codehighlighter1_855_999_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_855_999_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_855_999_Closed_Text.style.display='none'; Codehighlighter1_855_999_Open_Image.style.display='inline'; Codehighlighter1_855_999_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_855_999_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_855_999_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;UnicodeEncoding(</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.CompressBuffer(</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteLen&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xef</SPAN><SPAN style="COLOR: #000000">))&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xbb</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xbf</SPAN><SPAN style="COLOR: #000000">)))<BR><IMG id=Codehighlighter1_1215_1362_Open_Image onclick="this.style.display='none'; Codehighlighter1_1215_1362_Open_Text.style.display='none'; Codehighlighter1_1215_1362_Closed_Image.style.display='inline'; Codehighlighter1_1215_1362_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1215_1362_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1215_1362_Closed_Text.style.display='none'; Codehighlighter1_1215_1362_Open_Image.style.display='inline'; Codehighlighter1_1215_1362_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1215_1362_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1215_1362_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Encoding.UTF8;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.CompressBuffer(</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;((((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteLen&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">4</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">))&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;((</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xfe</SPAN><SPAN style="COLOR: #000000">)))&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer[</SPAN><SPAN style="COLOR: #000000">3</SPAN><SPAN style="COLOR: #000000">]&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0xff</SPAN><SPAN style="COLOR: #000000">))<BR><IMG id=Codehighlighter1_1554_1673_Open_Image onclick="this.style.display='none'; Codehighlighter1_1554_1673_Open_Text.style.display='none'; Codehighlighter1_1554_1673_Closed_Image.style.display='inline'; Codehighlighter1_1554_1673_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1554_1673_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1554_1673_Closed_Text.style.display='none'; Codehighlighter1_1554_1673_Open_Image.style.display='inline'; Codehighlighter1_1554_1673_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1554_1673_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1554_1673_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;UTF32Encoding(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flag1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteLen&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_1735_1802_Open_Image onclick="this.style.display='none'; Codehighlighter1_1735_1802_Open_Text.style.display='none'; Codehighlighter1_1735_1802_Closed_Image.style.display='inline'; Codehighlighter1_1735_1802_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1735_1802_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1735_1802_Closed_Text.style.display='none'; Codehighlighter1_1735_1802_Open_Image.style.display='inline'; Codehighlighter1_1735_1802_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1735_1802_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1735_1802_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">._detectEncoding&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(flag1)<BR><IMG id=Codehighlighter1_1847_2102_Open_Image onclick="this.style.display='none'; Codehighlighter1_1847_2102_Open_Text.style.display='none'; Codehighlighter1_1847_2102_Closed_Image.style.display='inline'; Codehighlighter1_1847_2102_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1847_2102_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1847_2102_Closed_Text.style.display='none'; Codehighlighter1_1847_2102_Open_Image.style.display='inline'; Codehighlighter1_1847_2102_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1847_2102_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1847_2102_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.decoder&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding.GetDecoder();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">._maxCharsPerBuffer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.encoding.GetMaxCharCount(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.byteBuffer.Length);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.charBuffer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">._maxCharsPerBuffer];<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN></SPAN></DIV>
<P><BR>水平有限，不妥之处，欢迎指正。<BR></STRONG>&nbsp; </FONT></P>
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/627173.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47987/" target="_blank">预测：Twitter最可能收购的十家公司</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>开源OA系统启动:文挡存储与office集成方案的选择[注:已关闭,勿关注,表歉意]</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/19/BPowerOA_05_DocumentSolutionSelected.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 19 Jan 2007 09:55:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/19/BPowerOA_05_DocumentSolutionSelected.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/625007.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/19/BPowerOA_05_DocumentSolutionSelected.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/625007.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/625007.html</trackback:ping><description><![CDATA[摘要: 本文简单比较了WSS，WebDav，第三方控件以及组合应用的方案。当然这个仅仅是我个人的拙见，希望能起到抛砖引玉的作用，大家一起探讨下。期待您大家的高见能撑出一片新的天空！<br><br>&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/19/BPowerOA_05_DocumentSolutionSelected.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/625007.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47986/" target="_blank">网易澄清:与暴雪合资公司仅提供技术支持</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>VS2005 Winform程序不能启动调试，别忘了启动Terminal Services服务[记录]</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/17/622168.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Tue, 16 Jan 2007 19:17:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/17/622168.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/622168.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/17/622168.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/622168.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/622168.html</trackback:ping><description><![CDATA[摘要: &nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/17/622168.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/622168.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47985/" target="_blank">杰克逊悼念仪式或成史上最大规模Web活动</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>开源OA系统启动:基础数据,工作流设计。[注:已关闭,勿关注,表歉意]</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/13/BPowerOA_03_BaseAndWorkflowDesign.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 13 Jan 2007 08:18:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/13/BPowerOA_03_BaseAndWorkflowDesign.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/619611.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/13/BPowerOA_03_BaseAndWorkflowDesign.html#Feedback</comments><slash:comments>32</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/619611.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/619611.html</trackback:ping><description><![CDATA[摘要: 自从开源OA系统启动:系统概览放出来后。园友们反馈了一些不错的建议。主要集中在工作流部分。本来是先不考虑工作流部分。这些天的交流和思考。决定把工作流部分作为系统基础结构贯穿整个系统。所以先考虑了这个部分的设计，因为这部分的设计是否合理关系到整个系统是否可以继续和是否有实际价值的问题。自己不敢独断专行。特放出来。让大家拍拍砖。期待各位园友一如即往提供专业意见！&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/13/BPowerOA_03_BaseAndWorkflowDesign.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/619611.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47984/" target="_blank">《商业周刊》:Mozilla的志愿者开发模式被复制</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>系统问题解决记录:IIS 500内部错误之解决办法</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/08/615239.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 08 Jan 2007 14:07:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/08/615239.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/615239.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/08/615239.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/615239.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/615239.html</trackback:ping><description><![CDATA[摘要: IIS 500内部错误之解决办法，这个是我自己遇到问题，参考google资料解决问题后，做个简单的log.以备查！&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/08/615239.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/615239.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47977/" target="_blank">Mono 的Virtual PC 虚拟机</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>开源OA系统启动:系统概览[注:已关闭,勿关注,表歉意]</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/06/BPowerOA_01_SystemPreview.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 05 Jan 2007 22:23:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/06/BPowerOA_01_SystemPreview.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/613297.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/06/BPowerOA_01_SystemPreview.html#Feedback</comments><slash:comments>37</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/613297.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/613297.html</trackback:ping><description><![CDATA[摘要:  做了两年多的开发工作,想做过很多事情,终于决定做点事情了---开发一个开放源代码的办公自动化系统(开源OA系统),刚刚启动.所以有很多工作要做.这次先给对这个OA感兴趣的朋友一些概览,但现在不会设立开源项目给大家下载,因为系统还没有什么可以运行的东西.同时期待大家提供支持和建议,通过大家的反馈以判断这个项目是否有必要继续.下一步将起草系统详细设计,数据库设计,编码规范等文挡.&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2007/01/06/BPowerOA_01_SystemPreview.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/613297.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47970/" target="_blank">19岁天才黑客发布首个iPhone 3GS破解软件</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Asp.Net下通过切换CSS换皮肤</title><link>http://www.cnblogs.com/kwklover/archive/2007/01/03/610822.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Wed, 03 Jan 2007 13:23:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2007/01/03/610822.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/610822.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2007/01/03/610822.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/610822.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/610822.html</trackback:ping><description><![CDATA[<P>&nbsp;换皮肤的方式有很多种，最简单的通常就是切换页面CSS，而CSS通常写在外部CSS文件里。那么切换css其实就是更换html里的link href路径。我在网上搜索了下。一般有两种方式：</P>
<P>1,在页面放一个holder控件。然后用编程方式把当前用户的风格css link写入页面。<BR>2,通过反射机制，逐个控件设置css样式。<BR>上面两种方式都挺麻烦的，<BR>第一种需要在每个页面上放一个holder控件。类似的做法还有把link标签加runat=server的做法。页面多了，都比较麻烦。<BR>第二种不用考虑了。性能编程效率上问题多多。</P>
<P>记得以前在学习DNN的时候，在他里面发现了一种修改form里默认的action地址的方式，直接参考下。还不错：<BR>直接重写Render事件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected override void Render(System.Web.UI.HtmlTextWriter writer)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringWriter sw = new StringWriter() ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HtmlTextWriter htmlWriter = new HtmlTextWriter(sw) ;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.Render(htmlWriter) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //当前用户选择的风格css<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string css = "&lt;link href=\"css url\" rel=\"stylesheet\" type=\"text/css\"&gt;" ;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string html = sw.ToString() ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int startPoint = html.IndexOf("&lt;/head&gt;", StringComparison.CurrentCultureIgnoreCase);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (startPoint &gt; 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html = html.Insert(startPoint, css);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Write(html) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>把这个放在每个页面的基类PageBase里。那就方便多了。<BR>当然，如果不想在让每个page都继承自定义的基类的方式，那也可以通过在HttpModule里写。也很方便.<BR>一处写好，页页受用呀。</P>
<P>&nbsp;</P><img src ="http://www.cnblogs.com/kwklover/aggbug/610822.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47969/" target="_blank">新浪邮箱大本营粉墨登场！Sina.cn开放注册</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>有意思.在线版的photoshop</title><link>http://www.cnblogs.com/kwklover/archive/2006/12/23/601169.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 23 Dec 2006 02:36:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/12/23/601169.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/601169.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/12/23/601169.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/601169.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/601169.html</trackback:ping><description><![CDATA[有时候需要处理点小图片的话,可以不用安装笨重的photoshop了.当然功能没有photoshop那么强大了.<A href="http://www.fauxto.com"><BR>http://www.fauxto.com</A><img src ="http://www.cnblogs.com/kwklover/aggbug/601169.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47968/" target="_blank">IE市场份额首次跌破60%</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>电子商务教程[资源]</title><link>http://www.cnblogs.com/kwklover/archive/2006/12/09/586927.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 08 Dec 2006 17:55:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/12/09/586927.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/586927.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/12/09/586927.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/586927.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/586927.html</trackback:ping><description><![CDATA[<TABLE style="WIDTH: 381px; HEIGHT: 242px" height=242 cellSpacing=0 cellPadding=2 width=381 border=0>
<TBODY>
<TR>
<TD width="95%" height=14><A href="http://www.chinayantai.net/sw/shangwu1.htm" target=_blank>前言</A></TD></TR>
<TR>
<TD width="95%" height=14>第一篇 <A href="http://www.chinayantai.net/sw/shangwu2.htm" target=_blank>电子商务的发展与概念</A></TD></TR>
<TR>
<TD width="95%" height=14>第二篇 <A href="http://www.chinayantai.net/sw/shangwu3.htm" target=_blank>电子商务变革的冲击</A></TD></TR>
<TR>
<TD width="95%" height=14>第三篇 <A href="http://www.chinayantai.net/sw/shangwu4.htm" target=_blank>电子商务的环境要求</A></TD></TR>
<TR>
<TD width="95%" height=14>第四篇 <A href="http://www.chinayantai.net/sw/shangwu5.htm" target=_blank>电子商务的技术要求</A></TD></TR>
<TR>
<TD width="95%" height=14>第五篇 <A href="http://www.chinayantai.net/sw/shangwu6.htm" target=_blank>电子商务与各行业</A></TD></TR>
<TR>
<TD width="95%" height=14>第六篇 <A href="http://www.chinayantai.net/sw/shangwu7.htm" target=_blank>电子商务的主要模式</A></TD></TR>
<TR>
<TD width="95%" height=8>第七篇 <A href="http://www.chinayantai.net/sw/shangwu8.htm" target=_blank>全球电子商务发展策略</A></TD></TR>
<TR>
<TD width="95%" height=14>第八篇 <A href="http://www.chinayantai.net/sw/shangwu9.htm" target=_blank>电子商务高级论谈</A></TD></TR>
<TR>
<TD width="95%" height=14>第九篇<A href="http://www.chinayantai.net/sw/shangwu10.htm" target=_blank> 电子商务解决方案为电子商务支招</A></TD></TR></TBODY></TABLE><img src ="http://www.cnblogs.com/kwklover/aggbug/586927.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47965/" target="_blank">Google App Engine宕机6小时——云的安全在哪里？</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>SQL SERVER2005 Client Download info</title><link>http://www.cnblogs.com/kwklover/archive/2006/11/10/556651.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 10 Nov 2006 07:32:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/11/10/556651.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/556651.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/11/10/556651.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/556651.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/556651.html</trackback:ping><description><![CDATA[<A href="http://hertbook.vxv.cn/soft/sql_client.rar">http://hertbook.vxv.cn/soft/sql_client.rar</A><BR><BR>链接已无效<img src ="http://www.cnblogs.com/kwklover/aggbug/556651.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47961/" target="_blank">微软新推社交网站Windows Live Planet</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>CommunityServer2.0改造的一些心得[粗糙版]</title><link>http://www.cnblogs.com/kwklover/archive/2006/11/10/556649.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 10 Nov 2006 07:31:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/11/10/556649.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/556649.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/11/10/556649.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/556649.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/556649.html</trackback:ping><description><![CDATA[<P>1,关于选型<BR>&nbsp;如果打算快速实现BBS,BLOG,相册,下载等系统的通用社区型网站,CS2还是很好的选择来的.<BR>&nbsp;不过如果希望它作为一网站的一个产品独立发展,则CS2不是最好选择,如果让我选择,我觉得<BR>&nbsp;ANF(bbs.hidotnet.com) + 博客园的blog会更好一些,因为CS2整合的东西太多,内部复杂度很大<BR>&nbsp;每个APP的改造幅度过大.都很可能对其他的APP产生影响.为了不影响,要考虑的东西比较多.<BR>&nbsp;对于大型应用.发展到最后还是要分离的.迟早要分,还不如早分.而且各个功能点独立发展<BR>&nbsp;自由度会更高.特别适合团队开发方式.当然,分离了就要考虑用户信息的SSO等等,但那不是重点.<BR>&nbsp;置于相册和下载等系统.目前未发现有好的东西.<BR>&nbsp;下载部分,DNN的文件上传和管理非常强大,可以拿来借鉴和改造.</P>
<P>2,CS2的个性化是基于皮肤的,但换皮肤的成本很高.需要重新做很多的UserControl.<BR>现在有很多的论坛系统是基于风格的.换风格只是换颜色和图片,相对来说成本比较低.<BR>但不能改变布局,所以各有千秋.其实CS2只要处理得当,是可以同时兼顾两种方式的.</P>
<P><BR>3,关于html的DOCTYPE的问题<BR>如果你为CS2改造而设计新的界面,最后在设计阶段的页面观看效果的时候,一定要加上(不同的DTD可参考其他资料)<BR>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "<A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd</A>"&gt; <BR>&lt;html xmlns="<A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>" xml:lang="en" lang="en"&gt;</P>
<P>因为有和没有这个JS和CSS的行为和效果很不相同,而CS2的很效果的JS是需要有这个才正常运行的<BR>所以设计时要考虑这个.</P>
<P>4, 同一个页面不同的文本框回车响应不同的事件<BR>&nbsp;这个文章(<A href="http://www.dezai.cn/index/Article_Show.asp?ArticleID=7694">http://www.dezai.cn/index/Article_Show.asp?ArticleID=7694</A>)提了两个方式。<BR>有一个需要改form的onkeydown event,这样不好。我综合了一下，不用改form.<BR>&nbsp; function SearchShortCut(evt)<BR>&nbsp; {<BR>&nbsp;&nbsp;&nbsp; if(evt.keyCode == 13)<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpenSearchWin() ; //这个为一JS方法<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; evt.keyCode = 9 ; //转移为tab事件<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp; }<BR>然后设置搜索框的onkeydown="SearchShortCut(event);"，这样输入关键字按回车就可以提交搜索了。</P>
<P>5,图片大小可按鼠标滚轮滚动自动缩放的JS 。<BR>&nbsp; function bbimg(o)<BR>&nbsp; {<BR>&nbsp;var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom&gt;0) o.style.zoom=zoom+'%';<BR>&nbsp;return false;<BR>&nbsp; }<BR>然后在img标签上加上onmousewheel="return bbimg(this);" </P>
<P>6,CS2.x freetextbox的问题。以及初步解决方案<BR>在CS2.x出现下面的两个FTB问题：<BR>1)<BR>FreeTextBox has not been correctly installed. To install FreeTextBox either:<BR>(1) add a reference to FtbWebResource.axd in web.config:<BR>&lt;system.web&gt;<BR>&lt;httpHandlers&gt;<BR>&lt;add verb="GET"<BR>path="FtbWebResource.axd"<BR>type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" /&gt;<BR>&lt;/httpHandlers&gt;<BR>&lt;/system.web&gt;</P>
<P>(2) Save the FreeTextBox image and javascript files to a location on your website and set up FreeTextBox as follows <BR>&lt;FTB:FreeTextBox id="FreeTextBox1" SupportFolder="ftbfileslocation" JavaScriptLocation="ExternalFile" ButtonImagesLocation="ExternalFile" ToolbarImagesLocation="ExternalFile" ButtonImagesLocation="ExternalFile" runat="server" /&gt;<BR>分析，方案：按照上面的提示加上(观察中,未能确定是否有问题)。不过奇怪的是不加也没问题，只不过不知道什么时候又出现上面的提示。</P>
<P>2)出现异常，提示如下：<BR>The path \ITDBClub\FreeTextBox3\Languages\ cannot be found (D:\BBS\ITDBBBS\Web\FreeTextBox3\Languages\). <BR>分析，方案：这个问题比较难跟踪。因为所提示的路径确实是存在的，后来我把Languages下的所有语言问题去掉。只保留zh-cn。到目前为止还未发现这个异常了。估计和缓存有一定关系</P>
<P>7,打开窗口最大化<BR>一般看帖都喜欢最大化<BR>window.moveTo(0,0);<BR>window.resizeTo(screen.width,screen.height);</P>
<P>8,提交的html文本,自动修正html格式(比如，开头闭和不完整的去除)<BR>参见:CommunityServer.Components.HtmlNestingCorrectionModule类</P>
<P><BR>================17:04 2006-8-17===================<BR>1,发帖恢复上次提交功能<BR>参考资料：<BR><A href="http://blog.csdn.net/asthlon/archive/2004/11/11/177291.aspx">http://blog.csdn.net/asthlon/archive/2004/11/11/177291.aspx</A><BR><A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/persistence/overview.asp">http://msdn.microsoft.com/library/default.asp?url=/workshop/author/persistence/overview.asp</A></P>
<P>2,在线用户信息<BR>参考资料:<BR><A href="http://hesicong.cnblogs.com/archive/2005/08/17/216956.aspx">http://hesicong.cnblogs.com/archive/2005/08/17/216956.aspx</A><BR><A href="/rexsp/archive/2004/12/27/82740.html">http://www.cnblogs.com/rexsp/archive/2004/12/27/82740.html</A><BR><A href="http://lumaqq.linuxsir.org/article/qqwry_format_detail.html">http://lumaqq.linuxsir.org/article/qqwry_format_detail.html</A></P>
<P>3,图片上传功能<BR>主要的一点是CS2的安全性控制的很严格和灵活。所有没有在CommunityServer.config的MarkUp的HTML，JS标签等会被过滤掉。<BR>如果需要出现类似&lt;img src='url' onmousewheel='return bbimg(this)' onload='if(this.width&gt;550)this.width=550' border='0'&gt;<BR>这样的标签的话，那就需要在MarkUp里定义一下，否则，会被过滤掉一部分标签。<BR></P><img src ="http://www.cnblogs.com/kwklover/aggbug/556649.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47961/" target="_blank">微软新推社交网站Windows Live Planet</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>DotLucene源码浅读笔记(2) : Lucene.Net.Documents</title><link>http://www.cnblogs.com/kwklover/archive/2006/10/24/537818.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 23 Oct 2006 17:22:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/10/24/537818.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/537818.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/10/24/537818.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/537818.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/537818.html</trackback:ping><description><![CDATA[摘要: 这个写的比较抱歉,因为已经开始阅读Index部分了,Documents这个部分很早之前写了,但觉得没什么价值没发表,荒芜了一段时间,现在又开始了.这篇仅仅为了系列的完整.也发表了吧,大家随便仍鸡蛋吧 :).这个命名空间的类相对较少，也相对较简单,一共才四个类，主要的类是Document,Field,在DotLucene中，可以这样认为，Document就是一种类似于数据库中的数据列的数据结构，Fi&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2006/10/24/537818.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/537818.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47960/" target="_blank">火狐3.5版被指推出太匆忙：存在50多个漏洞</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>DotLucene源码浅读笔记(1)补遗:编写简单中文分词器ChineseAnalyzer</title><link>http://www.cnblogs.com/kwklover/archive/2006/10/24/537813.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 23 Oct 2006 17:09:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/10/24/537813.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/537813.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/10/24/537813.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/537813.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/537813.html</trackback:ping><description><![CDATA[原理部分,可以参考<A class=postTitle2 id=viewpost1_TitleUrl href="/kwklover/archive/2006/06/25/435421.html"><FONT color=#56b6e9>DotLucene源码浅读笔记(1) : Lucene.Net.Analysis</FONT></A> ,本篇是依据上篇文章的分析,编写出的简单中文分词器(ChineseAnalyzer).<BR>从<A class=postTitle2 id=viewpost1_TitleUrl href="/kwklover/archive/2006/06/25/435421.html"><FONT color=#56b6e9>DotLucene源码浅读笔记(1) : Lucene.Net.Analysis</FONT></A>可以知道,与分词有关的主要是两个基类:<BR>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><FONT face=Arial><FONT size=2><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">词法分析器<SPAN lang=EN-US>(<SPAN style="COLOR: teal">Analyzer</SPAN>) ：</SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体">词法过滤和分析的类，实际上是对</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">分词器<SPAN lang=EN-US>, 过滤器的综合包装类。<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></FONT></FONT></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><FONT face=Arial><FONT size=2>分词器<SPAN lang=EN-US>(<SPAN style="COLOR: teal">Tokenizer</SPAN>)：对文本进行分词，可能是单字，词，二元切分等等。<BR><o:p><BR>而最基础的概念是Token,Token是<SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体"><FONT face=Arial><FONT size=2>DotLucene最基本的单位，以单字切分则每个单字为一个Token,如果以中文分词来切分则每个词为一个Token,<BR><BR>另外,中文分词器</FONT><FONT size=3>ChineseAnalyzer并不是中文分词,</FONT><FONT size=2>中文分词器仅仅是对</FONT><FONT size=3>中文分词的结果分析成DotLucene索引器能够认识的格式,<BR><BR>先实现分词器(Tokenizer),代码中用了一个第三方的分词组件做实验.<BR></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG id=Codehighlighter1_4_144_Open_Image onclick="this.style.display='none'; Codehighlighter1_4_144_Open_Text.style.display='none'; Codehighlighter1_4_144_Closed_Image.style.display='inline'; Codehighlighter1_4_144_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_4_144_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_4_144_Closed_Text.style.display='none'; Codehighlighter1_4_144_Open_Image.style.display='inline'; Codehighlighter1_4_144_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_4_144_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_4_144_Open_Text><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;DotLucene中文分词器<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;Author&nbsp;:邝伟科 &nbsp;</SPAN><SPAN style="COLOR: #008000; TEXT-DECORATION: underline">http://www.cnblogs.com/kwklover</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;dated&nbsp;&nbsp;:&nbsp;2006/10/24<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></SPAN><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;ChineseTokenizer&nbsp;:&nbsp;Tokenizer<BR><IMG id=Codehighlighter1_195_1113_Open_Image onclick="this.style.display='none'; Codehighlighter1_195_1113_Open_Text.style.display='none'; Codehighlighter1_195_1113_Closed_Image.style.display='inline'; Codehighlighter1_195_1113_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_195_1113_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_195_1113_Closed_Text.style.display='none'; Codehighlighter1_195_1113_Open_Image.style.display='inline'; Codehighlighter1_195_1113_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_195_1113_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_195_1113_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;List</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;ioBuffer;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;offSet&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">偏移量.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;position&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">&nbsp;;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">词汇在缓冲中的位置.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;length&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">词汇的长度.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;start&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">开始偏移量.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ChineseTokenizer(System.IO.TextReader&nbsp;input)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;</SPAN><SPAN style="COLOR: #0000ff">base</SPAN><SPAN style="COLOR: #000000">(input)<BR><IMG id=Codehighlighter1_513_635_Open_Image onclick="this.style.display='none'; Codehighlighter1_513_635_Open_Text.style.display='none'; Codehighlighter1_513_635_Closed_Image.style.display='inline'; Codehighlighter1_513_635_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_513_635_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_513_635_Closed_Text.style.display='none'; Codehighlighter1_513_635_Open_Image.style.display='inline'; Codehighlighter1_513_635_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_513_635_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_513_635_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">这里用了一个第三方的中文分词组件.</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ioBuffer&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Sj110.Com.Chinese.Tokenizer.Tokenize(input.ReadToEnd());<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">DotLucene的分词器简单来说，就是实现Tokenizer的Next方法，把分解出来的每一个词构造为一个Token，因为Token是DotLucene分词的基本单位。</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">override</SPAN><SPAN style="COLOR: #000000">&nbsp;Token&nbsp;Next()<BR><IMG id=Codehighlighter1_779_1107_Open_Image onclick="this.style.display='none'; Codehighlighter1_779_1107_Open_Text.style.display='none'; Codehighlighter1_779_1107_Closed_Image.style.display='inline'; Codehighlighter1_779_1107_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_779_1107_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_779_1107_Closed_Text.style.display='none'; Codehighlighter1_779_1107_Open_Image.style.display='inline'; Codehighlighter1_779_1107_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_779_1107_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_779_1107_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;position</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(position&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">&nbsp;ioBuffer.Count)<BR><IMG id=Codehighlighter1_860_1071_Open_Image onclick="this.style.display='none'; Codehighlighter1_860_1071_Open_Text.style.display='none'; Codehighlighter1_860_1071_Closed_Image.style.display='inline'; Codehighlighter1_860_1071_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_860_1071_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_860_1071_Closed_Text.style.display='none'; Codehighlighter1_860_1071_Open_Image.style.display='inline'; Codehighlighter1_860_1071_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_860_1071_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_860_1071_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;length&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ioBuffer[position].Length;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;offSet&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offSet&nbsp;</SPAN><SPAN style="COLOR: #000000">+=</SPAN><SPAN style="COLOR: #000000">&nbsp;length&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Token(ioBuffer[position],&nbsp;start,&nbsp;start&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;length);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN></DIV></FONT></FONT></SPAN></o:p></SPAN></FONT></FONT></SPAN><BR>中文分析器(<SPAN style="COLOR: teal"><FONT face=新宋体 size=2>Analyzer</FONT></SPAN>)代码:<BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;ChineseAnalyzer&nbsp;:&nbsp;Analyzer<BR><IMG id=Codehighlighter1_48_406_Open_Image onclick="this.style.display='none'; Codehighlighter1_48_406_Open_Text.style.display='none'; Codehighlighter1_48_406_Closed_Image.style.display='inline'; Codehighlighter1_48_406_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_48_406_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_48_406_Closed_Text.style.display='none'; Codehighlighter1_48_406_Open_Image.style.display='inline'; Codehighlighter1_48_406_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_48_406_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_48_406_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ChineseAnalyzer()<BR><IMG id=Codehighlighter1_91_101_Open_Image onclick="this.style.display='none'; Codehighlighter1_91_101_Open_Text.style.display='none'; Codehighlighter1_91_101_Closed_Image.style.display='inline'; Codehighlighter1_91_101_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_91_101_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_91_101_Closed_Text.style.display='none'; Codehighlighter1_91_101_Open_Image.style.display='inline'; Codehighlighter1_91_101_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_91_101_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_91_101_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">override</SPAN><SPAN style="COLOR: #000000">&nbsp;TokenStream&nbsp;TokenStream(TextReader&nbsp;reader)<BR><IMG id=Codehighlighter1_178_400_Open_Image onclick="this.style.display='none'; Codehighlighter1_178_400_Open_Text.style.display='none'; Codehighlighter1_178_400_Closed_Image.style.display='inline'; Codehighlighter1_178_400_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_178_400_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_178_400_Closed_Text.style.display='none'; Codehighlighter1_178_400_Open_Image.style.display='inline'; Codehighlighter1_178_400_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_178_400_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_178_400_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TokenStream&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ChineseTokenizer(reader);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;LowerCaseFilter(result);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">result&nbsp;=&nbsp;new&nbsp;StopFilter(result,&nbsp;stopSet);&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">你还可以自己编写过滤器。</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;result;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN></DIV>上面是一个简单的DotLucene的ChineseAnalyzer,算法并不是最优的.主要用于理解如何实现ChineseAnalyzer<BR><BR>文中涉及到的中文分词组件:<A href="/Files/kwklover/ChineseTokenizer.rar">点此下载</A>&nbsp;,中文分词组件版权归原作者所有,此出提供下载是为了大家学习之方便.用于商业目的,请自行联系作者. 
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV>
<img src ="http://www.cnblogs.com/kwklover/aggbug/537813.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47960/" target="_blank">火狐3.5版被指推出太匆忙：存在50多个漏洞</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Windows下傻瓜式快速搭建Discuz论坛(也可以参考用于搭建其他php论坛)</title><link>http://www.cnblogs.com/kwklover/archive/2006/09/13/502653.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Tue, 12 Sep 2006 17:45:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/09/13/502653.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/502653.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/09/13/502653.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/502653.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/502653.html</trackback:ping><description><![CDATA[<P><FONT size=2><STRONG>先说说几句废话。</STRONG><BR>在.Net领域，比较优秀的论坛有<A href="http://www.communityserver.org/">Community Server</A>,<A href="http://www.yetanother.com/">yetanotherforums</A>,CVBBS等等。 <BR>在php领域，优秀的论坛有phpwind,phpbb,Discuz,vBulletin等等</FONT></P>
<P><FONT size=2>在asp/.net领域的几个论坛我都尝试用过，不过都不是很优秀.比如Community Server架构很优秀，但很复杂，而且也不太符合国情。yetanotherforums发展的太慢。其架构比较新颖，但目前还不太成熟稳定。想发展中文官方版的，赶快出</FONT><FONT size=2>手罗。<BR>CVBBS是商业的，界面风格很美观简洁，有一定可拓展性，修改界面也很方面。但不开源，而又没有经过</FONT><FONT size=2>大规模的考验，其SEO做的也比较差。</FONT></P>
<P><FONT size=2>另外也有一些比较小型的论坛系统，就不一一罗列了，人生短暂，别让垃圾给糟蹋了。所以在.net平台下</FONT><FONT size=2>，我最喜欢Community Server。想看看范例可以看看我改造的论坛： <A href="http://bbs.itdb.cn/">以太论坛</A></FONT></P>
<P><FONT size=2>进入正题拉。<BR>php我比较少关注，但比较有名的论坛还是比较多。上面只是列了几个。其中discuz在国内用的比较多。</FONT></P>
<P><FONT size=2>而且有大款支持。想不优秀都难啊。那就先研究下这个论坛。以后再一个一个玩玩，不过我对php一窍不</FONT></P>
<P><FONT size=2>通，如果你也和我一样，又想用用这个论坛，又不想大费脑筋去搞那些糟糕的php,mysql,apache等配置。</FONT></P>
<P><FONT size=2><STRONG>那就follow me，就弄几下鼠标就可以搭建一个discuz论坛了.</STRONG></FONT><FONT size=2><BR>1,先下载一个免安装PHP Server(<A href="http://www.21andy.com/blog/20060512/279.html">介绍</A>, <A href="http://www.dualface.com/blog/downloads/apmxe4.exe">下载APMXE for PHP4</A> ,本文就用这个),然后安装到c盘，建个目录php好管理(其他盘也可以，不过我试了下不行</FONT><FONT size=2>，为了不伤你的脑细胞，建议你还是老实安装到c盘吧).</FONT></P>
<P><FONT size=2>2,看一下刚安装的c:\php目录下的几个文件夹,里面有apache,htdocs,mysql40,php4,等等，如果你连</FONT><FONT size=2>apache,mysql都不知道啥东西，那也不要紧，你只要知道htdocs是用来放php文件的。等会discuz就放这</FONT><FONT size=2>个文件夹了</FONT></P>
<P><FONT size=2>3,到discuz官方(</FONT><A href="http://www.discuz.net/"><FONT size=2>www.discuz.net</FONT></A><FONT size=2>)下载一个discuz 5.0正式版(建议UTF-8的，不要用GBK的，有些地方会</FONT><FONT size=2>乱码)。如果连这个你也不会，那我建议你找个全世界最高的地方往下跳.</FONT></P>
<P><FONT size=2>4,解压后把其中的upload文件拷贝到步骤2中的说的htdocs目录下，还是为了管理的方便，在里面建个</FONT><FONT size=2>discuz5，这样以后还可以安装discuz4等等。</FONT></P>
<P><FONT size=2>5,先启动APMXE4控制器(安装好后，桌面上就有了),然后浏览</FONT><A href="http://localhost/"><FONT size=2>http://localhost/</FONT></A><FONT size=2>,点phpMyAdmin-2.8.0.2/ <BR>进入mysql数据库管理,在里面创建一个数据库discuz5,然后选择这个数据库，在右上面的SQL栏的有一个</FONT><FONT size=2>执行SQL语句的地方。把discuz5的upload/install/discuz.sql复制过去，运行下，就完成数据库构建了</FONT><FONT size=2>。<BR>然后修改下discuz论坛的config.inc.php,看里面的说明就知道怎么修改了。默认情况修改：<BR>&nbsp;$dbuser = 'root';&nbsp;&nbsp;&nbsp;// database username<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 数据库用户名</FONT></P>
<P><FONT size=2>&nbsp;$dbpw = '';&nbsp;&nbsp;&nbsp;// database password<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// 数据库密码</FONT></P>
<P><FONT size=2>&nbsp;$dbname = 'discuz5';&nbsp;&nbsp;&nbsp;// database name</FONT></P>
<P><FONT size=2>输入discuz的URL(</FONT><A href="http://localhost/discuz5"><FONT size=2>http://localhost/discuz5</FONT></A><FONT size=2>),就可以访问了。默认的管理员用户密码分别为admin </FONT></P>
<P><FONT size=2>admin,现在可以开启你的discuz之旅拉。<BR></FONT></P>
<P><FONT size=2><STRONG>有问题请到我的blog，<A href="/kwklover">http://www.cnblogs.com/kwklover</A>找到我的联系方式，知而尽言！<BR>善意提醒：正式发布别忘了修改下数据库密码和管理员密码(傻人总认为大家都一样傻:))</STRONG></FONT></P>
<P><FONT size=2><BR></FONT>&nbsp;</P><img src ="http://www.cnblogs.com/kwklover/aggbug/502653.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47959/" target="_blank">Google对手机搜索进行优化升级</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>CSS循序渐进系列</title><link>http://www.cnblogs.com/kwklover/archive/2006/08/13/475734.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 13 Aug 2006 10:11:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/08/13/475734.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/475734.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/08/13/475734.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/475734.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/475734.html</trackback:ping><description><![CDATA[<LI><A href="http://www.w3cn.org/article/step/2004/38.html"><FONT size=2>第12天:校验及常见错误</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/37.html"><FONT size=2>第11天:不用表格的菜单</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/36.html"><FONT size=2>第10天:自适应高度</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/35.html"><FONT size=2>第9天:第一个CSS布局实例</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/34.html"><FONT size=2>第8天:CSS布局入门</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/33.html"><FONT size=2>第7天:CSS入门</FONT></A><FONT size=2> (2004-6-25) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/31.html"><FONT size=2>第6天:XHTML代码规范</FONT></A><FONT size=2> (2004-6-24) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/30.html"><FONT size=2>第5天:head区的其他设置 </FONT></A><FONT size=2>(2004-6-24) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/29.html"><FONT size=2>第4天:调用样式表</FONT></A><FONT size=2> (2004-6-24) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/28.html"><FONT size=2>第3天:定义语言编码</FONT></A><FONT size=2> (2004-6-24) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/27.html"><FONT size=2>第2天:什么是名字空间</FONT></A><FONT size=2> (2004-6-24) </FONT>
<LI><A href="http://www.w3cn.org/article/step/2004/26.html"><FONT size=2>第1天:选择什么样的DOCTYPE</FONT></A><FONT size=2> (2004-6-24)</FONT></LI>
<P><FONT size=2>from : <A href="http://www.w3cn.org/article/step/index.html">http://www.w3cn.org/article/step/index.html</A></FONT></P><img src ="http://www.cnblogs.com/kwklover/aggbug/475734.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47958/" target="_blank">风声又起 Windows 7 RTM版7月13日完成</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>DotText研究资料整理</title><link>http://www.cnblogs.com/kwklover/archive/2006/07/31/464468.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Mon, 31 Jul 2006 14:54:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/07/31/464468.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/464468.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/07/31/464468.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/464468.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/464468.html</trackback:ping><description><![CDATA[<STRONG>DotText源码阅读系列：</STRONG><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl07_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/02/705039.aspx"><BR><FONT size=2>DotText源码阅读(0)</FONT></A><FONT size=2> <BR></FONT><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl06_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/04/707457.aspx"><FONT size=2>DotText源码阅读(1)-调试</FONT></A><FONT size=2> <BR></FONT>
<DIV class=postTitle><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl05_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/05/708639.aspx"><FONT size=2>DotText源码阅读(3)-框架配置体系和反序列化 </FONT></A><BR><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl04_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/06/709989.aspx"><FONT size=2>dotText源码阅读(4)--DTO和数据访问</FONT></A><FONT size=2> <BR></FONT><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl03_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/10/722389.aspx"><FONT size=2>dotText源码阅读(5)--URLreWrite和Handler</FONT></A><FONT size=2> <BR></FONT><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl02_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/13/727211.aspx"><FONT size=2>DotText源码阅读(6) --模版皮肤</FONT></A><FONT size=2> <BR></FONT><A id=CategoryEntryList.ascx_EntryStoryList_Entries_ctl01_TitleUrl href="http://blog.csdn.net/shanhe/archive/2006/05/17/741904.aspx"><FONT size=2>DotText源码阅读(7) --Pingback/TrackBack</FONT></A> <BR><BR><STRONG>优化DotText系列：</STRONG><BR><A id=viewpost1_TitleUrl href="/ddwinter/archive/2006/03/01/340434.html"><FONT color=#000080 size=2>优化DOTTEXT之一：缓存配置项</FONT></A><BR><A id=ArchiveMonth1_Days_Entries_ctl04_TitleUrl href="/ddwinter/archive/2006/03/01/340436.html"><FONT color=#000080 size=2>优化DOTTEXT之二：缓存用户控件</FONT></A><FONT size=2> <BR></FONT><A id=ArchiveMonth1_Days_Entries_ctl03_TitleUrl href="/ddwinter/archive/2006/03/01/340439.html"><FONT color=#000080 size=2>优化DOTTEXT之三：完善Trackback</FONT></A><FONT size=2> <BR></FONT><A id=ArchiveMonth1_Days_Entries_ctl02_TitleUrl href="/ddwinter/archive/2006/03/01/340442.html"><FONT color=#000080 size=2>优化DOTTEXT之四：TRACKBACK的流程和改进设想</FONT></A> </DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/464468.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47957/" target="_blank">乔布斯和埃利森</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>ASP.NET 2.0 Internet安全之参考实现</title><link>http://www.cnblogs.com/kwklover/archive/2006/07/22/457058.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 22 Jul 2006 03:06:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/07/22/457058.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/457058.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/07/22/457058.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/457058.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/457058.html</trackback:ping><description><![CDATA[<P>今天在<A class=HeaderMainTitle id=Header1_HeaderTitle href="http://blog.joycode.com/saucer/">思归呓语</A>的blog里看到<A id=viewpost.ascx_TitleUrl href="http://blog.joycode.com/saucer/archive/2006/07/22/79029.aspx">ASP.NET 2.0 Internet安全之参考实现</A>,看介绍很有吸引力．去down下来，大概看了一下文挡．很多大多不同程度使用过，但还没有从整体上去设计和考虑过．这个范例提供了一种输理和方向．收藏！</P><img src ="http://www.cnblogs.com/kwklover/aggbug/457058.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47956/" target="_blank">Xbox Live将投放Silverlight广告</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>摘录几句话,以备忘.有时候越简单的逻辑越不容易被人想起</title><link>http://www.cnblogs.com/kwklover/archive/2006/07/18/453692.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Tue, 18 Jul 2006 04:43:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/07/18/453692.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/453692.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/07/18/453692.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/453692.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/453692.html</trackback:ping><description><![CDATA[<FONT size=2>什么是商业价值？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 解决别人愿意花钱解决的问题，就是商业价值。<BR><BR>什么是市场规模？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 你解决的别人愿意花钱解决的问题存在的越普遍，市场规模越大。<BR><BR>什么是品牌？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当你遇到问题需要解决时，脑子中会出现的名字就是品牌。<BR><BR>什么是圈子？<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 圈子是事业的基础，人只可能赚熟人的钱。<BR><BR>另外:<BR>李钟伟的标准是你的手机里存的号码，80%是什么人，你就是什么人<BR>我演绎了一下，我觉得，主动给你打电话的，80%是什么人，你就是什么人<BR>from : <A href="http://blog.donews.com/sunnyliang/archive/2006/07/16/964514.aspx"><FONT color=#002c99 size=3>一个月想通的问题</FONT></A></FONT><FONT size=3> </FONT><img src ="http://www.cnblogs.com/kwklover/aggbug/453692.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47951/" target="_blank">Debian无视GNU创始人警告 接受Mono</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>社区设计细节 :  用户可选是否在新窗口中打开主题</title><link>http://www.cnblogs.com/kwklover/archive/2006/07/09/446485.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 09 Jul 2006 07:47:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/07/09/446485.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/446485.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/07/09/446485.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/446485.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/446485.html</trackback:ping><description><![CDATA[<P>一般的,很多社区在列表页里浏览具体主题的时候,基于各种考虑.默认要么全部打开新窗口,要么不打开新窗口,用户根本没有选择的余地,今天发现一个论坛,提供了一个复选按钮CheckBox,让用户自己决定是否打开新窗口浏览主题. 在这点上做的不错,赞一下,顺便也要把人家的技术给"偷"过来.其实比较简单了.关键是人家的设计思想有可借鉴之出,为了完整.把代码部分也弄出来:</P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">function</SPAN><SPAN style="COLOR: #000000">&nbsp;switchTopicOpenMode(box)<BR><IMG id=Codehighlighter1_34_291_Open_Image onclick="this.style.display='none'; Codehighlighter1_34_291_Open_Text.style.display='none'; Codehighlighter1_34_291_Closed_Image.style.display='inline'; Codehighlighter1_34_291_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_34_291_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_34_291_Closed_Text.style.display='none'; Codehighlighter1_34_291_Open_Image.style.display='inline'; Codehighlighter1_34_291_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_34_291_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_34_291_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">&nbsp;isPopNew&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;box.checked;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">&nbsp;anchorTags&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;document.getElementsByTagName('a');<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">var</SPAN><SPAN style="COLOR: #000000">&nbsp;i</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;&nbsp;i</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">anchorTags.length;&nbsp;i</SPAN><SPAN style="COLOR: #000000">++</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_163_289_Open_Image onclick="this.style.display='none'; Codehighlighter1_163_289_Open_Text.style.display='none'; Codehighlighter1_163_289_Closed_Image.style.display='inline'; Codehighlighter1_163_289_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_163_289_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_163_289_Closed_Text.style.display='none'; Codehighlighter1_163_289_Open_Image.style.display='inline'; Codehighlighter1_163_289_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_163_289_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_163_289_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(anchorTags[i].getAttribute('name')&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;'topiclink')&nbsp;</SPAN><SPAN style="COLOR: #0000ff">continue</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;anchorTags[i].target&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;isPopNew&nbsp;</SPAN><SPAN style="COLOR: #000000">?</SPAN><SPAN style="COLOR: #000000">&nbsp;'_blank'&nbsp;:&nbsp;'_self';<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV>然后放个CheckBox:<BR>&lt;input type='checkbox' onclick='javascript:switchTopicOpenMode(this)' id='keyofpopwin' /&gt;在新窗口中打开主题<BR><BR>另外.需要为列表的每个链接加上name=topiclink<img src ="http://www.cnblogs.com/kwklover/aggbug/446485.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47950/" target="_blank">iPhone 3GS首发日创AT&T多项纪录</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>DotLucene源码浅读笔记(1) : Lucene.Net.Analysis</title><link>http://www.cnblogs.com/kwklover/archive/2006/06/25/435421.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 25 Jun 2006 13:41:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/06/25/435421.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/435421.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/06/25/435421.html#Feedback</comments><slash:comments>14</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/435421.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/435421.html</trackback:ping><description><![CDATA[摘要: 本系列笔记将以DotLucene的命名空间组织行文，阅读的DotLucene版本是1.9.RC1,并且以更好的使用而非研究为目的阅读。也就是说要避难就易拉。0）, DotLucene主要命名空间概览： 命名空间功能说明Lucene.Net.Analysis语言分析器，主要用于切词，支持中文主要是扩展此类Lucene.Net.Documents索引存储时的文档结构管理，类似关系型数据库的表结构Luc&nbsp;&nbsp;<a href='http://www.cnblogs.com/kwklover/archive/2006/06/25/435421.html'>阅读全文</a><img src ="http://www.cnblogs.com/kwklover/aggbug/435421.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47949/" target="_blank">Silverlight开发大赛奖金高达10000美元</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Community Server 2.0 学习笔记：如何实现在线人数？</title><link>http://www.cnblogs.com/kwklover/archive/2006/06/19/429086.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 18 Jun 2006 16:13:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/06/19/429086.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/429086.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/06/19/429086.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/429086.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/429086.html</trackback:ping><description><![CDATA[<P><FONT size=2>其原理其实就是把当前访问CS的用户的信息保存在Cache中,然后定时清理Cache里在指定时间内不</FONT></P>
<P><FONT size=2>活动的用户信息，Cache里的用户数就是在线的用户数。 其核心实现在两个类：<BR>UsersOnline：在CommunityServer.Components命名空间下。封装了操作在线用户信息数据的</FONT></P>
<P><FONT size=2>Cache的方法，关注其中的SetLocation方法，然后在整个解决方案中搜索一下</FONT></P>
<P><FONT size=2>UsersOnline.SetLocation,就会发现其中的原由。</FONT></P>
<P><FONT size=2>AnonymousUserJob：也在CommunityServer.Components命名空间下。这个类其实是一个CS里的</FONT></P>
<P><FONT size=2>Job,CS里的Job可以理解为定时自动运行的程序的，用来清理在指定时间内不活动的在线用户信息</FONT></P>
<P><FONT size=2>的Cache。</FONT></P><img src ="http://www.cnblogs.com/kwklover/aggbug/429086.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47947/" target="_blank">微软告攒机商第一案胜诉</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>Community Server 2.0的脚本的一个小问题</title><link>http://www.cnblogs.com/kwklover/archive/2006/06/09/421598.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 09 Jun 2006 05:24:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/06/09/421598.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/421598.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/06/09/421598.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/421598.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/421598.html</trackback:ping><description><![CDATA[<P><FONT size=2>现在的网站都很有一个很流行这样一个功能，加载数据的时候。整个页面不刷新，但曾现不可用和半透明的状态。Community Server也有一个类似的功能，比如你发新帖的添加附件处，点击它。打开一个新窗口(其实只是一个iframe),整个背景曾现不可用和半透明的状态。这几天修改CS2的界面，把论坛板块放在一个框架页的左边。右边显示帖子列表</FONT><FONT size=2>，遇到一个问题，发表新帖子(在框架页的右边)的时候，添加附件老添加不进去，IE显示脚本错误，我直接把发表新帖</FONT><FONT size=2>子不放在框架页里浏览就OK。晕。<BR>&nbsp; 决定研究代码。发现了问题所在:<BR>&nbsp; 在CommunityerverControls20里的UploadAttachment类里的protected virtual void Save_Click(object sender, </FONT><FONT size=2>EventArgs e)方法里有一行<BR>&nbsp; const string resultArray = "&lt;script language=\"javascript\"&gt;window.returnVal = new Array(\"{0}</FONT><FONT size=2>\",\"{1}\",\"{2}\",{3});window.top.hidePopWin(true);&lt;/script&gt;";<BR>&nbsp; 通过调试，window.top.hidePopWin(true)没有执行到。<BR>&nbsp; 查DHTML文档发现 window.top 的作用是 获取最顶层的祖先窗口。 靠，怪不得了，把window.top换成window.parent就OK</FONT><FONT size=2>了</FONT></P>
<P><FONT size=2>&nbsp;整个过程说明两个问题：<BR>&nbsp;1，CS2在脚本上写的还是不够严谨(环境变化会影响功能)；<BR>&nbsp;2，本人对脚本知识不精，没能一眼看出window.top的问题，浪费了一个上午的时间。</FONT><BR>&nbsp; </P><img src ="http://www.cnblogs.com/kwklover/aggbug/421598.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47946/" target="_blank">Mono这只猴子招惹了谁？</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>大型社区设计：提高用户体验的１０个细节</title><link>http://www.cnblogs.com/kwklover/archive/2006/06/03/416779.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 03 Jun 2006 15:20:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/06/03/416779.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/416779.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/06/03/416779.html#Feedback</comments><slash:comments>11</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/416779.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/416779.html</trackback:ping><description><![CDATA[<P><A href="http://kwklover.cnblogs.com/kwklover">http://kwklover.cnblogs.com/kwklover</A>　<BR>&nbsp;&nbsp;&nbsp;&nbsp; 　最近在开发社区程序，收集和自己想了一些能提高用户体验的社区设计理念，拿出来和大家讨论讨论．<BR>1,大型社区导航的设计三点考虑：<BR>&nbsp;&nbsp; 1 “随时”出现在用户手边；<BR>&nbsp;&nbsp; 2&nbsp; 尽量减少对页面的占用 ；<BR>&nbsp;&nbsp; 3&nbsp; 给用户良好的“位置感”；<BR>&nbsp;现在的一般的大型社区都是采用左侧可隐藏式的框架设计来实现的。<BR>&nbsp;关于位置感觉，在导航拦的体现就是 当前浏览的拦目要突出显示 <BR>&nbsp;参考：<A href="http://blog.donews.com/iqst/archive/2006/05/13/867531.aspx">http://blog.donews.com/iqst/archive/2006/05/13/867531.aspx</A></P>
<P>2,"恢复上一次提交"功能<BR>&nbsp; http协议是无连接的，由于网络不稳定导致用户发表失败，应该提供可恢复的手段。</P>
<P>3,完全可定制的可见即可得编辑器 ，分三种情况<BR>&nbsp;&nbsp; 1，用户可自己选择自己喜欢的编辑器。比如freetextbox,....<BR>&nbsp;&nbsp; 2，用户可定制编辑器的某些功能，比如有些用户喜欢发表图片，发表视频，但有些确喜欢<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 插入代码等，应该提供可选的定制功能，以避免过多的功能影响使用的方便性能和提高<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 加载速度。<BR>&nbsp;&nbsp; 3，具备一定的智能，比如进入贴图区，贴图功能自动出现，用户进入程序设计区，自动出现插入<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 代码功能，等等。</P>
<P>4,可匿名回复帖子。<BR>&nbsp;&nbsp; 有很多网站提供这个功能，也有很多网站不提供这个功能。我认为是否提供这个功能是判断<BR>&nbsp;&nbsp; 一个社区是否体贴用户的一个标志。时刻记着，引导用户注册而非强迫用户注册。前者带来<BR>&nbsp;&nbsp; 的注册用户对社区的认同感和粘性将更强。</P>
<P>5,分页的考虑<BR>&nbsp;1,用户应该可以随时选择 每页显示20条，还是40条，或其他指定的任何分页值。这个可用于<BR>&nbsp; 列表页，也可用于内容页的情况。<BR>&nbsp;2,尽量用数字表示页码，而不是上页/下页的样式。baidu,google的设计的就不错。</P>
<P><BR>6,站内短消息功能<BR>&nbsp;1，容量应该是有限度的。比如最多保存20条等。站内短消息是用来即时交流和通知信息<BR>&nbsp;&nbsp;&nbsp; 不是用来存储的。以提醒用户及时处理自己的信息。同时也可清理那些N年不来一次的<BR>&nbsp;&nbsp;&nbsp; 用户的短消息，以避免浪费系统资源。<BR>&nbsp;2，可导出短消息。<BR>&nbsp;3，草稿箱功能。满足两种用户需要：先写好，想想是否要发；写完了，突然不想发，但不肯定<BR>&nbsp;&nbsp;&nbsp; 将来要不要发，提供保存功能。<BR>&nbsp;4,可设置不接收某些用户的信息，或者不接受所有用户的信息。</P>
<P>7,贴心的搜索功能<BR>&nbsp; 一般的老用户在你的社区呆久了，自然就会添加了很多好友，收藏了很多帖子。也可能发表<BR>&nbsp; 了很多帖子，应该提供精确定向的搜索功能，可搜索自己的发表的或收藏的帖子，好友的发<BR>&nbsp; 表的帖子的等等。这个功能大多的社区都没提供。</P>
<P>8，在用户写作区(编辑器)的某个合适的地方提供搜索框<BR>&nbsp; 可用google或baidu的搜索框。有些用户喜欢在线写作，偶尔需要搜索引用些资料。这样会<BR>&nbsp; 给用户提供一定的方便。还有可能为网站增加收入。但要注意，以不影响用户写作为前提。<BR>&nbsp; 这个功能特别适合技术类的blog。</P>
<P>9，智能化的推荐帖<BR>&nbsp; 有些社区在精华帖之外，还有个推荐帖的概念，不过我认为推荐帖不是由网站决定的，而应该<BR>&nbsp;根据用户以往的浏览记录，收藏记录。用户信息的爱好等信息智能判断提取用户最有可能喜欢的<BR>&nbsp;帖子做为推荐帖子，当然也可能考虑帖子的多种考虑因素，增加推荐成功率。</P>
<P>10，楼主/博主的回复“突出显示”<BR>&nbsp;这个在某些时候会很有用。不过我觉得对blog特别有用。因为你阅读博主blog的文章，对博主<BR>&nbsp;的回复自然感兴趣，对论坛的意思不是特别大。<BR>参考:<A href="http://www.blueidea.com/bbs/NewsDetail.asp?lp=2&amp;id=2579436">http://www.blueidea.com/bbs/NewsDetail.asp?lp=2&amp;id=2579436</A></P>
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/416779.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47945/" target="_blank">Firefox 3.5本月晚些时候即首次升级</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>类似baidu google分页页码效果的代码</title><link>http://www.cnblogs.com/kwklover/archive/2006/04/21/381832.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Fri, 21 Apr 2006 15:59:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/04/21/381832.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/381832.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/04/21/381832.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/381832.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/381832.html</trackback:ping><description><![CDATA[<FONT size=2><STRONG><FONT color=#ff0000>以后做图片网站用过，现在只写出代码，其实没什么技术含量，只是最近工作不顺，心情稍差，思维有点懒惰，工作的时候需要抄过来用用ＯＫ，所才Post在此．</FONT></STRONG>　　<BR></FONT>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><IMG id=Codehighlighter1_2_47_Open_Image onclick="this.style.display='none'; Codehighlighter1_2_47_Open_Text.style.display='none'; Codehighlighter1_2_47_Closed_Image.style.display='inline'; Codehighlighter1_2_47_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_2_47_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2_47_Closed_Text.style.display='none'; Codehighlighter1_2_47_Open_Image.style.display='inline'; Codehighlighter1_2_47_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2_47_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_2_47_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #808080"><FONT size=2>///</FONT></SPAN><FONT size=2><SPAN style="COLOR: #008000">&nbsp;创建并显示分页器<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;BuildPager(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;totalRecords,</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;currentPage,</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;pageSize,</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;pid)<BR><IMG id=Codehighlighter1_131_1081_Open_Image onclick="this.style.display='none'; Codehighlighter1_131_1081_Open_Text.style.display='none'; Codehighlighter1_131_1081_Closed_Image.style.display='inline'; Codehighlighter1_131_1081_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_131_1081_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_131_1081_Closed_Text.style.display='none'; Codehighlighter1_131_1081_Open_Image.style.display='inline'; Codehighlighter1_131_1081_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_131_1081_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_131_1081_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;alter&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">4</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;startPage&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;endPage&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;alter&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;totalPages&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">this</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">.CalculateTotalPages(totalRecords,pageSize)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;alter)<BR><IMG id=Codehighlighter1_315_358_Open_Image onclick="this.style.display='none'; Codehighlighter1_315_358_Open_Text.style.display='none'; Codehighlighter1_315_358_Closed_Image.style.display='inline'; Codehighlighter1_315_358_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_315_358_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_315_358_Closed_Text.style.display='none'; Codehighlighter1_315_358_Open_Image.style.display='inline'; Codehighlighter1_315_358_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_315_358_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_315_358_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;startPage&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;alter&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(endPage&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;totalPages)<BR><IMG id=Codehighlighter1_392_424_Open_Image onclick="this.style.display='none'; Codehighlighter1_392_424_Open_Text.style.display='none'; Codehighlighter1_392_424_Closed_Image.style.display='inline'; Codehighlighter1_392_424_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_392_424_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_392_424_Closed_Text.style.display='none'; Codehighlighter1_392_424_Open_Image.style.display='inline'; Codehighlighter1_392_424_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_392_424_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_392_424_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endPage&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;totalPages&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;strTemp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">&lt;a&nbsp;href='PhotoList.aspx?pid={0}&amp;pno={1}'&gt;{2}&lt;/a&gt;&amp;nbsp;&amp;nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuilder&nbsp;sb&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;StringBuilder(</SPAN><SPAN style="COLOR: #000000">""</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;startPage)<BR><IMG id=Codehighlighter1_594_661_Open_Image onclick="this.style.display='none'; Codehighlighter1_594_661_Open_Text.style.display='none'; Codehighlighter1_594_661_Closed_Image.style.display='inline'; Codehighlighter1_594_661_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_594_661_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_594_661_Closed_Text.style.display='none'; Codehighlighter1_594_661_Open_Image.style.display='inline'; Codehighlighter1_594_661_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_594_661_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_594_661_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Format(&nbsp;strTemp&nbsp;,&nbsp;pid&nbsp;,&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">&nbsp;,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">上一页</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;)&nbsp;)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;startPage&nbsp;;&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;endPage&nbsp;;&nbsp;i</SPAN><SPAN style="COLOR: #000000">++</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;)<BR><IMG id=Codehighlighter1_716_916_Open_Image onclick="this.style.display='none'; Codehighlighter1_716_916_Open_Text.style.display='none'; Codehighlighter1_716_916_Closed_Image.style.display='inline'; Codehighlighter1_716_916_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_716_916_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_716_916_Closed_Text.style.display='none'; Codehighlighter1_716_916_Open_Image.style.display='inline'; Codehighlighter1_716_916_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_716_916_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_716_916_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(&nbsp;currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;i&nbsp;)<BR><IMG id=Codehighlighter1_749_820_Open_Image onclick="this.style.display='none'; Codehighlighter1_749_820_Open_Text.style.display='none'; Codehighlighter1_749_820_Closed_Image.style.display='inline'; Codehighlighter1_749_820_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_749_820_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_749_820_Closed_Text.style.display='none'; Codehighlighter1_749_820_Open_Image.style.display='inline'; Codehighlighter1_749_820_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_749_820_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_749_820_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&lt;font&nbsp;color=red&gt;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&lt;/font&gt;&amp;nbsp;&amp;nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #0000ff"><FONT size=2>else</FONT></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG id=Codehighlighter1_835_911_Open_Image onclick="this.style.display='none'; Codehighlighter1_835_911_Open_Text.style.display='none'; Codehighlighter1_835_911_Closed_Image.style.display='inline'; Codehighlighter1_835_911_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_835_911_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_835_911_Closed_Text.style.display='none'; Codehighlighter1_835_911_Open_Image.style.display='inline'; Codehighlighter1_835_911_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN id=Codehighlighter1_835_911_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><FONT size=2><IMG src="http://www.cnblogs.com/Images/dot.gif"></FONT></SPAN><SPAN id=Codehighlighter1_835_911_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Format(&nbsp;strTemp&nbsp;,&nbsp;pid&nbsp;,&nbsp;i&nbsp;,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">]</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;)&nbsp;)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">(currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;endPage)<BR><IMG id=Codehighlighter1_952_1032_Open_Image onclick="this.style.display='none'; Codehighlighter1_952_1032_Open_Text.style.display='none'; Codehighlighter1_952_1032_Closed_Image.style.display='inline'; Codehighlighter1_952_1032_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_952_1032_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_952_1032_Closed_Text.style.display='none'; Codehighlighter1_952_1032_Open_Image.style.display='inline'; Codehighlighter1_952_1032_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_952_1032_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_952_1032_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Format(&nbsp;strTemp&nbsp;,&nbsp;pid&nbsp;,&nbsp;currentPage&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">&nbsp;,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">下一页</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>)&nbsp;)&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">.ltlShowPager.Text&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;sb.ToString()&nbsp;;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN><SPAN style="COLOR: #000000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_1086_1217_Open_Image onclick="this.style.display='none'; Codehighlighter1_1086_1217_Open_Text.style.display='none'; Codehighlighter1_1086_1217_Closed_Image.style.display='inline'; Codehighlighter1_1086_1217_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1086_1217_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1086_1217_Closed_Text.style.display='none'; Codehighlighter1_1086_1217_Open_Image.style.display='inline'; Codehighlighter1_1086_1217_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN id=Codehighlighter1_1086_1217_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><FONT size=2>/**/</FONT></SPAN><SPAN id=Codehighlighter1_1086_1217_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><SPAN style="COLOR: #808080"><FONT size=2>///</FONT></SPAN><FONT size=2><SPAN style="COLOR: #008000">&nbsp;计算总页数<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="totalRecords"&gt;</SPAN><SPAN style="COLOR: #008000">总记录数</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="pageSize"&gt;</SPAN><SPAN style="COLOR: #008000">每页记录数</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;CalculateTotalPages(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;totalRecords,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;pageSize)&nbsp;<BR><IMG id=Codehighlighter1_1287_1507_Open_Image onclick="this.style.display='none'; Codehighlighter1_1287_1507_Open_Text.style.display='none'; Codehighlighter1_1287_1507_Closed_Image.style.display='inline'; Codehighlighter1_1287_1507_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_1287_1507_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1287_1507_Closed_Text.style.display='none'; Codehighlighter1_1287_1507_Open_Image.style.display='inline'; Codehighlighter1_1287_1507_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1287_1507_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_1287_1507_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;totalPagesAvailable;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalPagesAvailable&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;totalRecords&nbsp;</SPAN><SPAN style="COLOR: #000000">/</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;pageSize;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">由于C#的整形除法&nbsp;会把所有余数舍入为0，所以需要判断是否需要加1</SPAN></FONT><SPAN style="COLOR: #008000"><BR><FONT size=2><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;((totalRecords&nbsp;</SPAN><SPAN style="COLOR: #000000">%</SPAN><SPAN style="COLOR: #000000">&nbsp;pageSize)&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;totalPagesAvailable</SPAN><SPAN style="COLOR: #000000">++</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;totalPagesAvailable;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</FONT></SPAN></SPAN></DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/381832.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47944/" target="_blank">Google App Engine出现故障宕机6小时</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>开发人员一定要加入收藏夹的网站[持续更新]</title><link>http://www.cnblogs.com/kwklover/archive/2006/04/12/372747.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Tue, 11 Apr 2006 16:49:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/04/12/372747.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/372747.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/04/12/372747.html#Feedback</comments><slash:comments>23</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/372747.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/372747.html</trackback:ping><description><![CDATA[<DIV class=postcontent><FONT size=2>下面是我收集整理的对开发技术人员的学习，工作都非常有帮助的网站，也希望大家把自己认为最有帮助的网站分享给大家．<FONT style="BACKGROUND-COLOR: #ffffff" color=#ff0000><STRONG><BR></STRONG><FONT color=#000000><BR></FONT></FONT></FONT><A href="http://www.gotapi.com/"><FONT size=2><STRONG>http://www.gotapi.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：HTML,CSS,XPATH,XSL,JAVASCRIPT等API的查询网站。<BR></FONT><A href="http://www.w3schools.com/"><FONT size=2><STRONG>http://www.w3schools.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：W3C制定的标准诸如XML,HTML,XSL等等的在线学习教程。<BR></FONT><A href="http://www.xml.org.cn/"><FONT size=2><STRONG>http://www.xml.org.cn/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：可以说是XML的中国官方网吧。W3C标准的翻译组织与XML系列技术交流社区.<BR></FONT><A href="http://www.connectionstrings.com/"><FONT size=2><STRONG>http://www.connectionstrings.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：这里几乎收集了所有的数据库连接字符(connectionstring)了。<BR></FONT><A href="http://www.itpub.net/"><FONT size=2><STRONG>http://www.itpub.net/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：我个人认为是国内最专业的综合性行业性技术类社区.<BR></FONT><A href="http://www.netvtm.com/"><FONT size=2><STRONG>http://www.netvtm.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：内容多翻译于w3schools.com，少有原创。不过还是应该鼓励精品翻译。<BR></FONT><A href="http://www.regexlib.com/"><FONT size=2><STRONG>http://www.regexlib.com</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：正则表达式库。搜索正则表达式用。<BR><A href="http://www.rexv.org/"><STRONG>http://www.rexv.org/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：用Ajax开发的在线正则表达式验证器.<BR></FONT><A href="http://www.koders.com/"><FONT size=2><STRONG>http://www.koders.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：代码搜索引擎，可以搜索几十种语言的代码。<BR></FONT><A href="http://www.123aspx.com/Rotor/"><FONT size=2><STRONG>http://www.123aspx.com/Rotor/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：.Net Frameworks的源代码。<BR></FONT><A href="http://dotnet.aspx.cc/"><FONT size=2><STRONG>http://dotnet.aspx.cc/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：孟宪会的资料站，虽资料大多比较简单，却解决了开发中的大部分问题？！<BR></FONT><A href="http://www.dofactory.com/Patterns/Patterns.aspx"><FONT size=2><STRONG>http://www.dofactory.com/Patterns/Patterns.aspx</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：23种设计模式的实现参考。特点是UML+精练的示例代码+简洁的解说风格。<BR></FONT><A href="http://www.open-open.com/"><FONT size=2><STRONG>http://www.open-open.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：Java开源大全,如果你用.NET，照着它的名字前加N找找应该都有吧 ？！：）<BR></FONT><A href="http://www.riacn.com/"><FONT size=2><STRONG>http://www.riacn.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：我认为是国内少有的RIA专业技术站于交流社区.<BR></FONT><A href="http://www.cnpaf.net/"><FONT size=2><STRONG>http://www.cnpaf.net/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：中国协议分析网，很全面的协议资料网。<BR></FONT><A href="http://www.pinvoke.net/"><FONT size=2><STRONG>http://www.pinvoke.net/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：英语<BR>&nbsp;简介：通过.net调用win32等非受控API的资料大全。<BR></FONT><A href="http://bbs.51js.com/"><FONT size=2><STRONG>http://bbs.51js.com/</STRONG></FONT></A><BR><FONT size=2>&nbsp;语言：中文<BR>&nbsp;简介：无忧脚本,专业的脚本技术社区。<BR><A href="http://www.c-sharpcorner.com/"><STRONG>http://www.c-sharpcorner.com/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：C# Corner,学习c#的好地方.<BR></FONT><FONT size=2><U><FONT color=#800080><A href="http://blog.csdn.net/group/experts/"><STRONG>http://blog.csdn.net/group/experts/</STRONG></A><BR></FONT></U>&nbsp;语言：中文<BR>&nbsp;简介：CSDN专家群,汇集CSDN专家的电子报.<BR><A href="http://www.codeproject.com/"><STRONG>http://www.codeproject.com/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：有很多可学习的示例代码，特点是丰富，深入浅出．<BR><A href="http://www.gotdotnet.com/"><STRONG>http://www.gotdotnet.com/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：微软开发维护的关于.net framework交流社区.<BR><A href="http://www.sourceforge.net/"><STRONG>http://www.sourceforge.net/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：全球最大的开源软体站点<BR><A href="http://www.asp.net/QuickStart/"><STRONG>http://www.asp.net/QuickStart/</STRONG></A><BR>&nbsp;语言：英语<BR>&nbsp;简介：Microsoft .NET Framework SDK QuickStart Tutorials<BR><A href="http://www.matrix.org.cn/"><STRONG><FONT color=#0000ff>http://www.matrix.org.cn/</FONT></STRONG></A><BR>&nbsp;语言：中文<BR>&nbsp;简介：与 Java 共舞,Java优秀的专业社区,文章质量很高.做.Net的朋友也可以从其借鉴很多知识.<BR><A href="http://www.codeplex.com/"><STRONG>http://www.codeplex.com/</STRONG></A><BR>语言：英文<BR>简介：微软的开放源代码网站<BR><A href="http://www.google.com/codesearch"><STRONG>http://www.google.com/codesearch</STRONG></A><BR>语言：英文<BR>简介：Google的源代码搜索引擎<BR><BR><STRONG>enjoy your job!</STRONG></FONT> </DIV>
<DIV>
<SCRIPT type=text/javascript><!--
google_ad_client = "pub-0893130004371947";
google_alternate_color = "FFFFFF";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
//2007-04-14: cnblogs
google_ad_channel = "6603241763";
//-->
</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript>
</SCRIPT>
</DIV><img src ="http://www.cnblogs.com/kwklover/aggbug/372747.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47943/" target="_blank">消息称Facebook今年营收将达5.5亿美元</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>对象数组与ArrayList互转的简单方法[摘录]</title><link>http://www.cnblogs.com/kwklover/archive/2006/04/09/370718.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sun, 09 Apr 2006 10:31:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/04/09/370718.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/370718.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/04/09/370718.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/370718.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/370718.html</trackback:ping><description><![CDATA[<FONT size=2>对象数组转换成ArrayList可以使用ArrayList.Adapter方法:<BR><SPAN style="COLOR: #000000">Person[]&nbsp;personArray&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;myPerson.GetPersons();<BR></SPAN><SPAN style="COLOR: #000000">ArrayList&nbsp;personList&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><SPAN style="COLOR: #000000"><FONT size=2>&nbsp;ArrayList.Adapter(personArray)<BR><BR>把一个ArrayList转换成对象数组可以使用ArrayList.ToArray方法<BR><SPAN style="COLOR: #000000">Person[]&nbsp;personArrayFromList&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(Person[])personList.ToArray(</SPAN><SPAN style="COLOR: #0000ff">typeof</SPAN><SPAN style="COLOR: #000000">(Person));<BR><BR>以上摘至:<A id=viewpost1_TitleUrl href="http://justinw.cnblogs.com/archive/2006/04/09/370609.html"><FONT size=3>Converting ArrayList to Array / Array to ArrayList C# (原创翻译)</FONT></A><FONT size=3> <BR></FONT></SPAN></FONT></SPAN><img src ="http://www.cnblogs.com/kwklover/aggbug/370718.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47937/" target="_blank">微软8月25日开始通过WSUS推送IE8</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>递归转非递归(学习笔记)</title><link>http://www.cnblogs.com/kwklover/archive/2006/04/08/369923.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 08 Apr 2006 04:09:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/04/08/369923.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/369923.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/04/08/369923.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/369923.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/369923.html</trackback:ping><description><![CDATA[<P><FONT size=2>在网上逛的时候发现一篇好文 </FONT><A href="http://spaces.msn.com/liangzhen/blog/cns!5BD84CB7346D6F70!460.entry?_c11_blogpart_blogpart=blogview&amp;_c=blogpart#comment"><FONT size=2>递归转非递归</FONT></A><FONT size=2>&nbsp;，阅读完，觉得有启发，把重点记录下来，另外作者是用ISO C++语言描述的，我在测试的时候把它改成C#2.0的拉：<BR><BR><STRONG>为什么要递归转非递归:</STRONG><BR>因为每一次的递归调用都需要压栈占用内存，效率不高．<BR><BR><STRONG>递归转非递归的两种方法：</STRONG><BR>下面以求n的阶乘来说明<BR>先给出一般的递归方法：<BR></FONT></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><IMG id=Code_Closed_Image_120207 onclick="this.style.display='none'; Code_Closed_Text_120207.style.display='none'; Code_Open_Image_120207.style.display='inline'; Code_Open_Text_120207.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><IMG id=Code_Open_Image_120207 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_120207.style.display='none'; Code_Closed_Image_120207.style.display='inline'; Code_Closed_Text_120207.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><SPAN id=Code_Closed_Text_120207 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">递归求阶乘</SPAN></FONT><SPAN id=Code_Open_Text_120207 style="DISPLAY: none"><BR><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><FONT size=2><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG id=Codehighlighter1_8_62_Open_Image onclick="this.style.display='none'; Codehighlighter1_8_62_Open_Text.style.display='none'; Codehighlighter1_8_62_Closed_Image.style.display='inline'; Codehighlighter1_8_62_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_8_62_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_8_62_Closed_Text.style.display='none'; Codehighlighter1_8_62_Open_Image.style.display='inline'; Codehighlighter1_8_62_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_8_62_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_8_62_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN></FONT><FONT size=2><SPAN style="COLOR: #008000">&nbsp;递归求阶乘<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><SPAN style="COLOR: #008080">&nbsp;4</SPAN><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;Factorial(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;n)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_108_405_Open_Image onclick="this.style.display='none'; Codehighlighter1_108_405_Open_Text.style.display='none'; Codehighlighter1_108_405_Closed_Image.style.display='inline'; Codehighlighter1_108_405_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_108_405_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_108_405_Closed_Text.style.display='none'; Codehighlighter1_108_405_Open_Image.style.display='inline'; Codehighlighter1_108_405_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_108_405_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_108_405_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(n&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_145_204_Open_Image onclick="this.style.display='none'; Codehighlighter1_145_204_Open_Text.style.display='none'; Codehighlighter1_145_204_Closed_Image.style.display='inline'; Codehighlighter1_145_204_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_145_204_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_145_204_Closed_Text.style.display='none'; Codehighlighter1_145_204_Open_Image.style.display='inline'; Codehighlighter1_145_204_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_145_204_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_145_204_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;n&nbsp;</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">&nbsp;Factorial(n&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(n&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_247_287_Open_Image onclick="this.style.display='none'; Codehighlighter1_247_287_Open_Text.style.display='none'; Codehighlighter1_247_287_Closed_Image.style.display='inline'; Codehighlighter1_247_287_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_247_287_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_247_287_Closed_Text.style.display='none'; Codehighlighter1_247_287_Open_Image.style.display='inline'; Codehighlighter1_247_287_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_247_287_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_247_287_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN></FONT><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_318_395_Open_Image onclick="this.style.display='none'; Codehighlighter1_318_395_Open_Text.style.display='none'; Codehighlighter1_318_395_Closed_Image.style.display='inline'; Codehighlighter1_318_395_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_318_395_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_318_395_Closed_Text.style.display='none'; Codehighlighter1_318_395_Open_Image.style.display='inline'; Codehighlighter1_318_395_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_318_395_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_318_395_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArgumentException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Argument&nbsp;Error</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN></SPAN></DIV><BR><FONT size=2>非递归方法一：循环法，前提是，待解决问题必须能够分解出可循环规律方可<BR>而n! = n! = n*(n-1)*(n-2)*....*1;从循环的角度理解就是：n!表示执行n次循环计算一个增量k，初始k=1和结果t=1;每次t乘以k++的值.从而可以得到：<BR></FONT>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><IMG id=Code_Closed_Image_120107 onclick="this.style.display='none'; Code_Closed_Text_120107.style.display='none'; Code_Open_Image_120107.style.display='inline'; Code_Open_Text_120107.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><IMG id=Code_Open_Image_120107 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_120107.style.display='none'; Code_Closed_Image_120107.style.display='inline'; Code_Closed_Text_120107.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><SPAN id=Code_Closed_Text_120107 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">循环求阶乘</SPAN></FONT><SPAN id=Code_Open_Text_120107 style="DISPLAY: none"><BR><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><FONT size=2><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG id=Codehighlighter1_8_62_Open_Image onclick="this.style.display='none'; Codehighlighter1_8_62_Open_Text.style.display='none'; Codehighlighter1_8_62_Closed_Image.style.display='inline'; Codehighlighter1_8_62_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_8_62_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_8_62_Closed_Text.style.display='none'; Codehighlighter1_8_62_Open_Image.style.display='inline'; Codehighlighter1_8_62_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_8_62_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_8_62_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN></FONT><FONT size=2><SPAN style="COLOR: #008000">&nbsp;循环求阶乘<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><SPAN style="COLOR: #008080">&nbsp;4</SPAN><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;FactorialByLoop(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;n)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_114_293_Open_Image onclick="this.style.display='none'; Codehighlighter1_114_293_Open_Text.style.display='none'; Codehighlighter1_114_293_Closed_Image.style.display='inline'; Codehighlighter1_114_293_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_114_293_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_114_293_Closed_Text.style.display='none'; Codehighlighter1_114_293_Open_Image.style.display='inline'; Codehighlighter1_114_293_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_114_293_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_114_293_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;k&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;t&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">&nbsp;(k&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;n)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_201_260_Open_Image onclick="this.style.display='none'; Codehighlighter1_201_260_Open_Text.style.display='none'; Codehighlighter1_201_260_Closed_Image.style.display='inline'; Codehighlighter1_201_260_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_201_260_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_201_260_Closed_Text.style.display='none'; Codehighlighter1_201_260_Open_Image.style.display='inline'; Codehighlighter1_201_260_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_201_260_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_201_260_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t&nbsp;</SPAN><SPAN style="COLOR: #000000">*=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;k;<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;k</SPAN><SPAN style="COLOR: #000000">++</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"><FONT size=2>13</FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;t;<BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN></SPAN></DIV><BR><FONT size=2>非递归方法二：自定义堆栈法，目的是为不能分析出来循环的递归操作提供开销可控的方法.如：<BR></FONT>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><IMG id=Code_Closed_Image_120640 onclick="this.style.display='none'; Code_Closed_Text_120640.style.display='none'; Code_Open_Image_120640.style.display='inline'; Code_Open_Text_120640.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" width=11 align=top><IMG id=Code_Open_Image_120640 style="DISPLAY: none" onclick="this.style.display='none'; Code_Open_Text_120640.style.display='none'; Code_Closed_Image_120640.style.display='inline'; Code_Closed_Text_120640.style.display='inline';" height=16 src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" width=11 align=top><SPAN id=Code_Closed_Text_120640 style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">自定义堆栈求阶乘</SPAN></FONT><SPAN id=Code_Open_Text_120640 style="DISPLAY: none"><BR><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><FONT size=2><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG id=Codehighlighter1_8_65_Open_Image onclick="this.style.display='none'; Codehighlighter1_8_65_Open_Text.style.display='none'; Codehighlighter1_8_65_Closed_Image.style.display='inline'; Codehighlighter1_8_65_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_8_65_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_8_65_Closed_Text.style.display='none'; Codehighlighter1_8_65_Open_Image.style.display='inline'; Codehighlighter1_8_65_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_8_65_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_8_65_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN></FONT><FONT size=2><SPAN style="COLOR: #008000">&nbsp;自定义堆栈求阶乘<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><SPAN style="COLOR: #008080">&nbsp;4</SPAN><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;FactorialByStack(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;n)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_118_424_Open_Image onclick="this.style.display='none'; Codehighlighter1_118_424_Open_Text.style.display='none'; Codehighlighter1_118_424_Closed_Image.style.display='inline'; Codehighlighter1_118_424_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_118_424_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_118_424_Closed_Text.style.display='none'; Codehighlighter1_118_424_Open_Image.style.display='inline'; Codehighlighter1_118_424_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_118_424_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_118_424_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stack</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;s&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Stack</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">();<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;t&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;temp;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s.Push(n);<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">&nbsp;((temp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;s.Peek())&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_288_392_Open_Image onclick="this.style.display='none'; Codehighlighter1_288_392_Open_Text.style.display='none'; Codehighlighter1_288_392_Closed_Image.style.display='inline'; Codehighlighter1_288_392_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_288_392_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_288_392_Closed_Text.style.display='none'; Codehighlighter1_288_392_Open_Image.style.display='inline'; Codehighlighter1_288_392_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_288_392_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_288_392_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t&nbsp;</SPAN><SPAN style="COLOR: #000000">*=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;s.Peek();<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s.Pop();<BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s.Push(temp&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;t;<BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN></SPAN></DIV><BR><FONT size=2>说明：以上代码在Visual Studio 2005 Express中测试通过．<BR></FONT><img src ="http://www.cnblogs.com/kwklover/aggbug/369923.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47935/" target="_blank">暴风称新旧版更换完毕 总计超4000万用户换装</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item><item><title>在.Net framework下遍历XML文挡树的两种算法</title><link>http://www.cnblogs.com/kwklover/archive/2006/04/08/369888.html</link><dc:creator>kwklover</dc:creator><author>kwklover</author><pubDate>Sat, 08 Apr 2006 03:00:00 GMT</pubDate><guid>http://www.cnblogs.com/kwklover/archive/2006/04/08/369888.html</guid><wfw:comment>http://www.cnblogs.com/kwklover/comments/369888.html</wfw:comment><comments>http://www.cnblogs.com/kwklover/archive/2006/04/08/369888.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/kwklover/comments/commentRss/369888.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/kwklover/services/trackbacks/369888.html</trackback:ping><description><![CDATA[<P><FONT size=2>在阅读</FONT><A href="http://www.linuxabc.net/book/bookinfo.php?id=272" target=_blank><FONT color=#6b6b52 size=2>ASP.NET_XML深入编程技术</FONT></A><FONT size=2>&nbsp;(PDF格式)一书的时候，发现遍历树的两种算法：深度优先和广度优先遍历文挡树,前一种需要使用递归，后者则不需要，本人大学时期数据结构学的不好，每每涉及到树，总喜欢用递归，希望以后能根据需要选用一种，不过没有时间再系统地学习数据结构了，那就平时多学多记吧！<BR>另外这个例子不错，还可以学到.net的XML DOM的一些操作方法.<BR></FONT></P>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG id=Codehighlighter1_0_97_Open_Image onclick="this.style.display='none'; Codehighlighter1_0_97_Open_Text.style.display='none'; Codehighlighter1_0_97_Closed_Image.style.display='inline'; Codehighlighter1_0_97_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_0_97_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_97_Closed_Text.style.display='none'; Codehighlighter1_0_97_Open_Image.style.display='inline'; Codehighlighter1_0_97_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN id=Codehighlighter1_0_97_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_0_97_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN></FONT><FONT size=2><SPAN style="COLOR: #008000">&nbsp;深度优先遍历文挡树(递归方法)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="currentNode"&gt;</SPAN><SPAN style="COLOR: #008000">当前节点</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><SPAN style="COLOR: #008080">&nbsp;5</SPAN><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;DOMDepthFirst(XmlNode&nbsp;currentNode)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_149_337_Open_Image onclick="this.style.display='none'; Codehighlighter1_149_337_Open_Text.style.display='none'; Codehighlighter1_149_337_Closed_Image.style.display='inline'; Codehighlighter1_149_337_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_149_337_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_149_337_Closed_Text.style.display='none'; Codehighlighter1_149_337_Open_Image.style.display='inline'; Codehighlighter1_149_337_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_149_337_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_149_337_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;XmlNode&nbsp;node&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;currentNode.FirstChild&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">&nbsp;(&nbsp;node&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_223_286_Open_Image onclick="this.style.display='none'; Codehighlighter1_223_286_Open_Text.style.display='none'; Codehighlighter1_223_286_Closed_Image.style.display='inline'; Codehighlighter1_223_286_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_223_286_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_223_286_Closed_Text.style.display='none'; Codehighlighter1_223_286_Open_Image.style.display='inline'; Codehighlighter1_223_286_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_223_286_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_223_286_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;DOMDepthFirst(&nbsp;node&nbsp;)&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;node&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;node.NextSibling&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"><FONT size=2>13</FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">do&nbsp;something&nbsp;else&nbsp;with&nbsp;currentNode&nbsp;herer</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;}</SPAN></FONT></SPAN></DIV><BR>
<DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><FONT size=2><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG id=Codehighlighter1_2_119_Open_Image onclick="this.style.display='none'; Codehighlighter1_2_119_Open_Text.style.display='none'; Codehighlighter1_2_119_Closed_Image.style.display='inline'; Codehighlighter1_2_119_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_2_119_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2_119_Closed_Text.style.display='none'; Codehighlighter1_2_119_Open_Image.style.display='inline'; Codehighlighter1_2_119_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2_119_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN></FONT><SPAN id=Codehighlighter1_2_119_Open_Text><FONT size=2><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN></FONT><FONT size=2><SPAN style="COLOR: #008000">&nbsp;广度优先遍历文挡树(非递归)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="root"&gt;</SPAN><SPAN style="COLOR: #008000">遍历的入口点，如果需要遍历整个文挡则是XmlDocument对象</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></FONT></SPAN><BR><FONT size=2><SPAN style="COLOR: #008080">&nbsp;5</SPAN><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;DOMBreadthFirst(XmlNode&nbsp;root)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_166_627_Open_Image onclick="this.style.display='none'; Codehighlighter1_166_627_Open_Text.style.display='none'; Codehighlighter1_166_627_Closed_Image.style.display='inline'; Codehighlighter1_166_627_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_166_627_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_166_627_Closed_Text.style.display='none'; Codehighlighter1_166_627_Open_Image.style.display='inline'; Codehighlighter1_166_627_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_166_627_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_166_627_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;Queue&nbsp;queue&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;Queue()&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;queue.Enqueue(root)&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;XmlNode&nbsp;currentNode&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN></FONT><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_266_550_Open_Image onclick="this.style.display='none'; Codehighlighter1_266_550_Open_Text.style.display='none'; Codehighlighter1_266_550_Closed_Image.style.display='inline'; Codehighlighter1_266_550_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_266_550_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_266_550_Closed_Text.style.display='none'; Codehighlighter1_266_550_Open_Image.style.display='inline'; Codehighlighter1_266_550_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_266_550_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_266_550_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">)<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_289_545_Open_Image onclick="this.style.display='none'; Codehighlighter1_289_545_Open_Text.style.display='none'; Codehighlighter1_289_545_Closed_Image.style.display='inline'; Codehighlighter1_289_545_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_289_545_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_289_545_Closed_Text.style.display='none'; Codehighlighter1_289_545_Open_Image.style.display='inline'; Codehighlighter1_289_545_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_289_545_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_289_545_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">如果queue为空，则抛错，跳出try&nbsp;section，这里是while循环的退出条件</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;currentNode&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;(XmlNode)queue.Dequeue()&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">16</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;(currentNode.HasChildNodes)<BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_430_539_Open_Image onclick="this.style.display='none'; Codehighlighter1_430_539_Open_Text.style.display='none'; Codehighlighter1_430_539_Closed_Image.style.display='inline'; Codehighlighter1_430_539_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_430_539_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_430_539_Closed_Text.style.display='none'; Codehighlighter1_430_539_Open_Image.style.display='inline'; Codehighlighter1_430_539_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_430_539_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_430_539_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">foreach</SPAN><SPAN style="COLOR: #000000">&nbsp;(XmlNode&nbsp;child&nbsp;</SPAN><SPAN style="COLOR: #0000ff">in</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">&nbsp;currentNode.ChildNodes)<BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_494_532_Open_Image onclick="this.style.display='none'; Codehighlighter1_494_532_Open_Text.style.display='none'; Codehighlighter1_494_532_Closed_Image.style.display='inline'; Codehighlighter1_494_532_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_494_532_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_494_532_Closed_Text.style.display='none'; Codehighlighter1_494_532_Open_Image.style.display='inline'; Codehighlighter1_494_532_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_494_532_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_494_532_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">21</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;queue.Enqueue(child)&nbsp;;<BR></SPAN><SPAN style="COLOR: #008080">22</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">23</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">24</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">25</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">26</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN></FONT><FONT size=2><SPAN style="COLOR: #000000">(System.InvalidOperationException&nbsp;ex)<BR></SPAN><SPAN style="COLOR: #008080">27</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_601_623_Open_Image onclick="this.style.display='none'; Codehighlighter1_601_623_Open_Text.style.display='none'; Codehighlighter1_601_623_Closed_Image.style.display='inline'; Codehighlighter1_601_623_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_601_623_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_601_623_Closed_Text.style.display='none'; Codehighlighter1_601_623_Open_Image.style.display='inline'; Codehighlighter1_601_623_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_601_623_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/Images/dot.gif"></SPAN></FONT><SPAN id=Codehighlighter1_601_623_Open_Text><FONT size=2><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">28</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">throw&nbsp;ex&nbsp;;</SPAN></FONT><SPAN style="COLOR: #008000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">29</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><FONT size=2><SPAN style="COLOR: #008080">30</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></FONT></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080"><FONT size=2>31</FONT></SPAN><FONT size=2><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">32</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></FONT></DIV>
<P><FONT size=2>使用方法:<BR></FONT><STRONG><FONT size=2>&nbsp;&nbsp;&nbsp;XmlDocument doc = new XmlDocument() ;<BR>&nbsp;&nbsp;&nbsp;doc.Load("test.xml") ;<BR>&nbsp;&nbsp;&nbsp;DOMDepthFirst(doc) ;<BR>&nbsp;&nbsp;&nbsp;DOMBreadthFirst(doc) ;</FONT></STRONG></P><img src ="http://www.cnblogs.com/kwklover/aggbug/369888.html?type=1" width = "1" height = "1" /><br/><br/>--------------------------<br/>新闻：<a href="http://news.cnblogs.com/n/47935/" target="_blank">暴风称新旧版更换完毕 总计超4000万用户换装</a><br/>网站导航: <a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://dotnet.cnblogs.com" target="_blank">.NET频道</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://zzk.cnblogs.com" target="_blank">找找看</a>]]></description></item></channel></rss>