﻿<?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>博客园-jeseeqing's technology roadmap</title><link>http://www.cnblogs.com/jeseeqing/</link><description /><language>zh-cn</language><lastBuildDate>Mon, 22 Mar 2010 12:16:04 GMT</lastBuildDate><pubDate>Mon, 22 Mar 2010 12:16:04 GMT</pubDate><ttl>60</ttl><item><title>剖析SharpDevelop：Command模式的应用 </title><link>http://www.cnblogs.com/jeseeqing/archive/2005/01/20/94660.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Thu, 20 Jan 2005 04:03:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2005/01/20/94660.html</guid><description><![CDATA[<p>阅读: 3513 评论: 11 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2005-01-20 12:03 <a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/20/94660.html" target="_blank">原文链接</a></p><P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center><FONT size=3><B style="mso-bidi-font-weight: normal"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">剖析</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">：</SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=EN-US style="mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Command</FONT></SPAN></B><B style="mso-bidi-font-weight: normal"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">模式的应用</SPAN></B></FONT><FONT face="Times New Roman"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><?xml:namespace prefix = o /><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">是一个非常优秀的开源项目，其中有一些思想非常出色的，如插件结构，服务设计，设计模式的应用，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">UI</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">与行为的抽离，以及可插入式的设计结构</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">, </FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">其中有些设计思想我已经应用到我以前开发过的一些项目中。由于我的文笔不好及工作太忙，所以一直没有写什么心得之类的笔记。现在有点时间，也来记录一下我的分析随笔，先来分析一下</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中模式的应用，至于其非常优秀的插件结构，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><A href="http://www.cnblogs.com/passos/archive/2004/10.html"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN"><FONT color=#800080>博客园</FONT></SPAN></A></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">已有兄弟作过分析了。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">在剖析</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Command</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">模式之前，先来看一下</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">.NET Framework</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中的菜单及工具栏处理存在的一些缺点：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 24pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l1 level1 lfo1; tab-stops: list 24.0pt; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">无法自动同步更新菜单项与工具项的状态以及相关的行为及特性，需要手动去处理两个事件，从而造成了相同的两个操作需要两次处理，也就造成了需要手动地同时维护多份相同的操作；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 24pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l1 level1 lfo1; tab-stops: list 24.0pt; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">无法重用菜单项这部分的功能，因为在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">dotnet</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中菜单项的单击需要集成在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">UI</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 24pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l1 level1 lfo1; tab-stops: list 24.0pt; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">无法很好地扩展，如需要增加或删除菜单项，则需要更改原有的代码及</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">UI</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">部分的设计，从而违反了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">OCP(</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">开闭</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">)</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">原则。按照</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">OCP</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">原则，当扩展相关的功能时，不应该修改原始的代码，而应该扩展该代码；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 24pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l1 level1 lfo1; tab-stops: list 24.0pt; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">无法将相关的消息当作原子状态处理，试想一下，如果一个系统不仅通过菜单、工具栏来操作用户接口，也可通过命令（如</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Visual Studio</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">就可以通过输入命令而执行相关的操作）来执行，如果不将相关的操作抽象出来的话，维护这个操作的成本太大。并且如果想实现更进一步的控制比如精确到原子状态的权限控制，则很难实现。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">我们可以运用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Command</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">模式，将菜单项相应的操作抽象出来，定义一个命令接口</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">ICommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">，此接口仅具有</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Run</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法，可以作为任何命令的基接口。但是由于菜单还具有一些其它的特性，如是否可见，是否可用，文本，需要执行此菜单项的宿主，所以再定义了一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口继承此接口，加入了一些新的特性，并定义了一个实现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口的抽象基类</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">MenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">，其它类可以派生此类。由于我自已修改了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中的一些设计，所以可能有些与原版的不一样。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> <BR><BR></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify"><SPAN lang=EN-US style="FONT-SIZE: 10pt"><?xml:namespace prefix = v /><v:shapetype id=_x0000_t75><v:stroke></v:stroke><v:formulas><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f></v:formulas><v:path></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><o:p></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">&nbsp;<IMG height=299 hspace=5 src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/CommandBarMenuUML.gif" width=587 align=baseline><BR>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ICommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口：是一个最基本的接口，代表一个动作的行为；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口：派生于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">ICommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口，作为菜单项或工具项所实现的行为及特性来使用；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IStatusUpdate</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口：描述一个能够更新状态的接口，当对象需要更新状态时将调用此接口，如菜单项需要动态地更新</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enable</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Visible</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">特性；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">MenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">抽象基类：实现了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口，任何菜单命令可以从此继承；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CustomCommandBarItem</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">：继承于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CommandBar</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">组件的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CommandBarButton</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">类，类似于菜单项或工具项，实现了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IStatusUpdate</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口，以根据</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Visible</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">、</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enabled</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">属性的改变而相应地更新其</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enabled,Visible</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">属性；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> <BR></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CustomCommandBarMenu</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">：继承于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CommandBar</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">组件的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CommandBarMenu</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">类，类似于菜单条。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">&nbsp;&nbsp;&nbsp; 当我们在客户端需要创建命令时，只需写相关的类继承于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">MenuCommand</FONT></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<IMG height=189 hspace=5 src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/CommandBarMenuUML2.jpg" width=420 align=baseline> <BR></o:p></SPAN></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">在这里使用了另外一个开源组件</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><A href="http://www.aisto.com/roeder/dotnet/"><SPAN style="mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman" color=#0000ff>CommandBar</FONT></SPAN></A></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CustomCommandBarItem</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">类的构造函数通过传入一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">类的实例与</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">关联起来，将单击事件</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">(OnClick</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">)</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">委托给</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">ICommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">接口的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Run</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法来执行，其</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Update</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法用于更新状态。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">CustomCommandBarMenu</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">类中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">OnDropDown</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法用于当打开菜单条时通过调用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IStatusUpdate</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Update</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法自动更新所有菜单项的状态。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">处理所有插件的菜单中，此处的设计是支持的基础。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">如果更进一步，可以在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">SharpDevelop</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中加入类似于</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Visual Studio</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">的&#8220;命令窗口&#8221;；如果是一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">ERP</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">系统或</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">MIS</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">系统，可以将权限控制写在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">IMenuCommand</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enabled</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">中，在执行</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Run</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">方法之前先检测</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enabled</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">，如果</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Enabled</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">false</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">则禁止执行，我先前写过一个权限框架，通过</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Attribute</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">及</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Reflect</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">技术来实现权限的自动控制。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-language: ZH-CN"><FONT face="Times New Roman"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></FONT></SPAN><FONT face="Times New Roman"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN">Reference:</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN></FONT> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 48pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l0 level1 lfo2; tab-stops: list 48.0pt; mso-line-height-rule: exactly"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><A href="http://www.cnblogs.com/zhenyulu/" target=_blank><SPAN lang=ZH-CN style="COLOR: #0000ff; FONT-FAMILY: SimSun; TEXT-DECORATION: none; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN; text-underline: none">吕震宇</SPAN></A></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">的设计模式系列文章</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt 48pt; TEXT-INDENT: -24pt; LINE-HEIGHT: 20pt; TEXT-ALIGN: justify; mso-list: l0 level1 lfo2; tab-stops: list 48.0pt; mso-line-height-rule: exactly"><FONT face="Times New Roman"><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN">GoF</SPAN></FONT><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">的</SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN"><FONT face="Times New Roman">Design Pattern</FONT></SPAN><SPAN lang=EN-US style="FONT-SIZE: 10pt"><o:p></o:p></SPAN> </P>
<P></P><img src="http://www.cnblogs.com/jeseeqing/aggbug/94660.html?type=1" width="1" height="1" alt=""/><p>评论: 11　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/20/94660.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/20/94660.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>抱谦，1月7日的会议因为后来有点事，我参加了10多分钟，后来中途退出！</title><link>http://www.cnblogs.com/jeseeqing/archive/2005/01/10/89278.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Mon, 10 Jan 2005 01:55:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2005/01/10/89278.html</guid><description><![CDATA[<p>阅读: 740 评论: 1 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2005-01-10 09:55 <a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/10/89278.html" target="_blank">原文链接</a></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><font size="3"><st1:chsdate w:st="on" IsROCDate="False" IsLunarDate="False" Day="7" Month="1" Year="2005"><span lang="EN-US" style="mso-fareast-language: ZH-CN; mso-fareast-font-family: SimSun"><font face="Times New Roman">1</font></span><span lang="ZH-CN" style="FONT-FAMILY: SimSun; mso-fareast-language: ZH-CN; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">月</span><span lang="EN-US" style="mso-fareast-language: ZH-CN; mso-fareast-font-family: SimSun"><font face="Times New Roman">7</font></span><span lang="ZH-CN" style="FONT-FAMILY: SimSun; mso-fareast-language: ZH-CN; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">日</span></st1:chsdate><span lang="ZH-CN" style="FONT-FAMILY: SimSun; mso-fareast-language: ZH-CN; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的会议我因为后来有点事，参加了</span><span lang="EN-US" style="mso-fareast-language: ZH-CN; mso-fareast-font-family: SimSun"><font face="Times New Roman">10</font></span><span lang="ZH-CN" style="FONT-FAMILY: SimSun; mso-fareast-language: ZH-CN; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">多分钟后来退出去了，<span lang="ZH-CN" style="FONT-FAMILY: SimSun; mso-fareast-language: ZH-CN; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">对</span>此表示抱谦。对于这次会议的成果，我只能通过会议记录总结了</span></font>
</p><img src="http://www.cnblogs.com/jeseeqing/aggbug/89278.html?type=1" width="1" height="1" alt=""/><p>评论: 1　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/10/89278.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/10/89278.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>三年工作的总结及杂想 </title><link>http://www.cnblogs.com/jeseeqing/archive/2005/01/04/86151.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Tue, 04 Jan 2005 04:18:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2005/01/04/86151.html</guid><description><![CDATA[<p>阅读: 1464 评论: 4 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2005-01-04 12:18 <a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/04/86151.html" target="_blank">原文链接</a></p><SPAN lang=ZH-CN style="FONT-SIZE: 14pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">随着钟声的敲响，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年就这样走过了，在这一年中国家取得了各方面的好成绩，大家正普天同庆的时候，独自一人深夜走在广州的街道上，迈着沉重的步伐，时有一丝寒风吹进我的心里。对于我来说，</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年是我从事软件开发的第三个年头，当</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2005</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年来临时，我怎样总结这几年的工作，怎样制定新的职业规划，好让人生指针指向一个有目标确定的地址。 <BR><BR></SPAN></P></SPAN>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><FONT face="Times New Roman"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore">1.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt">2001</SPAN></FONT><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年职业生涯总的来说，处于起步阶段，让我从一个陌生的行业渐渐确定了自已的方向，在这一年中我曾徘徊过做网络行业还是软件开发行业，也许当时对于我来说，这种选择是比较痛苦的，同时对自已又是有决定性作用的，一个偶然的机会及哥、朋友间的请示我坚决地决定了我未来十年的总体职业规划：成为一名优秀的软件工程师。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><?xml:namespace prefix = o /><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">2.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">对生活方式有了重新的想法。爸<SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-fareast-language: ZH-CN">妈</SPAN>出门前再三强调&#8220;出门靠朋友，在家靠父母&#8221;，经过几年的工作我认识到了朋友在人生道路上的重要性。一个好的知心朋友有时可以决定你的将来，你的职业，你的喜怒哀乐。在此我衷心地希望我的知心朋友能够在未来的人生旅途中一路凯歌，事事顺心，走向人生的辉煌，我祝福你们在新的一年一路走好！因为以前在学校太内向，在学校的各种活动也不是很活跃，现在经过很多的磨练，已经改变。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">3.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">多出来走走，对自已很有利！在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2001</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年朋友曾说过有机会走出长沙去外界转转，对你很有好处。我还不以为然，一次偶然机会使我走出了伤心之地长沙，来到了中国改革开放的前沿地－深圳特区。也许这次成为我职业生涯中的一个转折点，我从此起步，通过自己的不断努力将实现我事业上的成功。<SPAN style="COLOR: red">这里的生活节奏不允许我有丝毫的松懈，在这种激烈的竞争的环境中你只有苦学，苦练，苦问才会有立足之地。职业生涯中始终要记住：坚持，坚持，再坚持；失败，失败，再失败之后可能才有成功的机会；学习，学习，再学习才有说话的资源</SPAN>；</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">4.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在我工作了从事了半年软件开发之后，也就是从</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2002</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年中开始我投入了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">.NET</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的怀抱，从一个</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">VB</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员转变为</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">.NET</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">程序员。在这其中，从一个基于对象的思想并带有面向过程的思想的程序员完全转变为面向对象的程序员，这其中的转变多少也带有一些痛苦，但是转变成功后，发现</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">.NET</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的世界真是美好。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">5.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年结识了敏捷开发，并且在项目中实施了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">TDD</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，体验了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">TDD</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">这种轻型开发方法的魅力，其最大的特点完全发挥了程序员本身的因素，真正做到了以人为本。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: ZH-TW"><SPAN style="mso-list: Ignore"><FONT face="Times New Roman">6.<SPAN style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年下半年知道了</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">Blog</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">的存在，在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><A href="http://www.cnblogs.com/"><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><FONT color=#800080>博客园</FONT></SPAN></A></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">上安了家，在上面结识了一些朋友，并且在</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年的最后一天加入了<SPAN style="COLOR: red">博客园的&#8220;</SPAN></SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; COLOR: red"><A href="http://www.cnblogs.com/team/DesignPattern.html"><FONT color=#800080><FONT face="Times New Roman">Design &amp; Pattern</FONT><SPAN lang=ZH-CN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">团队</SPAN></FONT></A></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; COLOR: red; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;</SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，希望能在团队中能多交些朋友，多学点东西。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p><FONT face="Times New Roman">&nbsp;</FONT></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">总结</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">2004</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">年，收获了多少？缺点改变了多少？学到了多少？年初制定的计划实现了多少？做对了几件事？又做错了几件事？有了多少的进步？我想是我好好坐下来静静地想一想的时候了！时间不等人，在这个时代，速度、高效、学习、知识、信息充斥于地球地任一个角落。</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 新細明體"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 新細明體"><o:p><FONT face="Times New Roman"></FONT></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW"><o:p><FONT face="Times New Roman">&nbsp;</FONT></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><SPAN style="mso-tab-count: 10"><FONT face="Times New Roman">&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;&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;&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;&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Jesee Qing</FONT></SPAN></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman"><SPAN style="mso-tab-count: 10">&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;&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;&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;&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>2005.1.1</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">日</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><SPAN style="mso-tab-count: 10"><FONT face="Times New Roman">&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;&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;&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;&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;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">凌晨</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">0</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><FONT face="Times New Roman">10</FONT></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">分</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><SPAN style="mso-tab-count: 1"><FONT face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></SPAN></SPAN><SPAN lang=ZH-CN style="FONT-SIZE: 9.5pt; FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">书于广州</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9.5pt"><o:p></o:p></SPAN> </P>
<P></P></SPAN><img src="http://www.cnblogs.com/jeseeqing/aggbug/86151.html?type=1" width="1" height="1" alt=""/><p>评论: 4　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/04/86151.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2005/01/04/86151.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>我也来派发Gmail invitation ！</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/12/30/59300.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Thu, 30 Dec 2004 11:31:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/12/30/59300.html</guid><description><![CDATA[<p>阅读: 3415 评论: 87 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-12-30 19:31 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/30/59300.html" target="_blank">原文链接</a></p><P>看到Wayfer说到GMail的事，我也来派发GMail。 <BR><BR>申请到GMail已经差不多1个多月了，虽然其号称1G，但由于测试其间速度太慢，所以也就很少使用。 <BR><BR>现在手上有5个邀请，谁要的话留下email及其firstName,lastName。 <BR><BR>希望Google的东西永远是好东西，最近Google发布了Google Desktop Search，用于搜索桌面上的信息，可以与Google在线的集成。 <BR><BR><SPAN style="COLOR: #ff0000"><STRONG><STRONG><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-bidi-font-family: Arial">谁要的话留给</SPAN></STRONG><STRONG><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN">email</SPAN></STRONG><STRONG><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-bidi-font-family: Arial">，最后更新日期：</SPAN></STRONG><STRONG><SPAN lang=EN-US style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial; mso-fareast-font-family: SimSun; mso-fareast-language: ZH-CN">2005.8.15</SPAN></STRONG><STRONG><SPAN lang=ZH-CN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-bidi-font-family: Arial">日</SPAN></STRONG></STRONG></SPAN> </P><img src="http://www.cnblogs.com/jeseeqing/aggbug/59300.html?type=1" width="1" height="1" alt=""/><p>评论: 87　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/30/59300.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/30/59300.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>C# Programming Guidelines（摘录）</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/12/21/80161.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Tue, 21 Dec 2004 10:47:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/12/21/80161.html</guid><description><![CDATA[<p>阅读: 2107 评论: 10 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-12-21 18:47 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/21/80161.html" target="_blank">原文链接</a></p><p align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center; mso-outline-level: 1"><span lang="EN-US" style="FONT-SIZE: 14pt; FONT-FAMILY: Verdana">C# Programming Guidelines</span><span style="FONT-SIZE: 14pt"><font face="Simsun">（摘录）
<br/><span lang="EN-US"><o:p></o:p></span></font></span>
</p><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">以下条目来自于</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Larry O&#39;Brien</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">与</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Bruce Eckel</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的《</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">Think C#</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">》一书，我个人认为英文表达胜于使用中文来表达，所以也没有翻译相关的内容。</span>
</p></span>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">&#160;<o:p></o:p></span>
</p>
<ol type="1" start="1" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo1; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Elegance Always pays off. <o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="2" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo2; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">First make it work, then make it fast.<span style="mso-spacerun: yes">&#160; </span></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">在敏捷开发中，有一条原则：</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Keep it simple<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="3" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo3; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Remember the &quot;divide and conquer&quot; principle.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="4" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo4; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Separate the class creator from the class user (client programmer)<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="5" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo5; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">When you create a class, attempt to make your names so clear that comments are unnecessary. <o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="6" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo6; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Your analysis and design must produce, at minimum, the classes in your system, their public interfaces, and their relationships to other classes, especially base classes.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="7" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo7; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Automate everything. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">类似于敏捷开发中的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Continue Integrated.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="8" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo8; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Write the test code first (before you write the class) in order to verify that your class design is complete. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">类似于敏捷开发中的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Write Test First<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="9" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo9; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">All software design problems can be simplified by introducing an extra level of conceptual indirection.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="10" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo10; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">An indirection should have a meaning.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="11" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo11; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Make classes as atomic as possible.<span style="mso-spacerun: yes">&#160; </span></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">单一职责原则</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">(SRP)</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">很好地解释了这一点，</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">SRP</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">可以理解为为&#8220;就一个类而言，应该仅有一个引起它变化的原因&#8221;，详细信息请参阅《</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Agile Software Development Principles, Patterns, and Practices</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">》；</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="12" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo12; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch for long argument lists. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">可以使用重构中的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Introduce Parameter object</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">（引入参数对象）来重构代码，关于重构，请参阅《</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Refactoring: Improving the Design of Existing Code</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">》</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="13" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo13; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Don&#39;t repeat yourself. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">不要使你的代码有</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Duplicated Code</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">坏味道，当有后可以使用重构中的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Extract Method</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">手段来重构代码；</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="14" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo14; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch for switch statements or chained if-else clauses. </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">不要使你的代码有</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Switch Statements</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">坏味道，当有后可以使用重构中的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Replace Conditional with Polymorphism</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">手段来重构代码；</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"> <o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="15" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo15; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">From a design standpoint, look for and separate things that change from thins that stay the same.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="16" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo16; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Don&#39;t extend fundamental functionality by subclassing.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="17" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo17; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Less is more.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="18" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo18; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Read your classes aloud to make sure they&#39;re logical.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="19" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo19; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">When deciding between inheritance and composition, ask if you need to upcast to the base type.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="20" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo20; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Use data members for variation in value and method overriding for variation in behavior.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="21" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo21; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch for overloading.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="22" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo22; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Use exception hierarchies;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="23" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo23; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Sometimes simple aggregation does the job.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="24" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo24; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Consider the perspective of the client programmer and the person maintaining the code;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="25" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo25; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for &quot;giant object syndrome.&quot;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="26" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo26; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">If you must do something ugly, at least localize the ugliness inside a class.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="27" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo27; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">If you must do something nonportable, make an abstraction for that service and localize it within a class.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="28" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo28; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Objects should not simple hold some data.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="29" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo29; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Choose composition first when creating new classes from existing classes;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="30" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo30; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Use inheritance and method overriding to express differences in behavior, and fields to express variations in state.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="31" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo31; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for variance;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="32" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo32; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for limitation during inheritance.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="33" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo33; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Using design patterns to eliminate &quot;naked functionality.&quot;;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="34" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo34; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for &quot;analysis paralysis.&quot;;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="35" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l0 level1 lfo35; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">When you think you&#39;ve got a good analysis, design, or implementation, do a walkthrough.<o:p></o:p></span>
   </li>
</ol>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">&#160;<o:p></o:p></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Implementation<o:p></o:p></span>
</p>
<ol type="1" start="36" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo36; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">In general, follow the Microsoft coding conventions.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="37" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo37; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Whatever coding style you use, it really does make a difference if your team (and even better, your company) standardizes on it.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="38" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo38; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Follow standard capitalization rules.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="39" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo39; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Don&#39;t create your own &quot;decorated&quot; private data member names;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="40" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo40; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Follow a &quot;canonical form&quot; when creating a class for general-purpose use.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="41" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo41; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Sometimes you need to inherit in order to access protected members of the base class.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="42" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo42; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">If two classes are associated with each other in some functional way (such as containers and iterators), try to make one an inner class of the other;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="43" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo43; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Anytime you notice classes that appear to have high coupling with each other, consider the coding and maintenance improvements you might get by using inner classes;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="44" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo44; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Don&#39;t fall prey to premature optimization;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="45" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo45; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Keep scopes as small as possible so the visibility and lifetime of your objects are as small as possible.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="46" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo46; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Use the containers in the .NET Framework SDK.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="47" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo47; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">For a program to be robust, each component must be robust.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="48" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo48; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Prefer compile-time errors to run-time errors </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">尽可能地将错误在编译阶段解决</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="49" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo49; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch for long method definitions;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="50" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo50; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Keep things as &quot;private as possible&quot;; </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">应尽量少暴露外部接口给用户</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="51" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo51; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Use comments liberally, and use the comment-documentation syntax product your program documentation.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="52" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo52; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Avoid using &quot;magic numbers&quot;; </span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">应该使用常量来代替</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="53" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo53; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">When creating constructors, consider exceptions.<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="54" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo54; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">If your class requires any cleanup when the client programmer is finished with the object, make your class implement IDisposable interface;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="55" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo55; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">When you are creating a fixed-size container of objects, transfer them to an array;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="56" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo56; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Choose interfaces over abstract classes;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="57" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo57; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: yellow; COLOR: black; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun; mso-highlight: yellow">Inside constructors, do only what is necessary to set the object into the proper state;</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun"><o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="58" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo58; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for accidental overloading;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="59" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo59; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Watch out for premature optimization;<o:p></o:p></span>
   </li>
</ol>
<ol type="1" start="60" style="MARGIN-TOP: 0cm">
   <li class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; VERTICAL-ALIGN: middle; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-outline-level: 1; mso-list: l1 level1 lfo60; tab-stops: list 36.0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 0pt; mso-bidi-font-family: SimSun">Remember that code is read much more than it is written;<o:p></o:p></span>
   </li>
</ol>
<p style="TEXT-JUSTIFY: inter-ideograph; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: justify; mso-outline-level: 1"><span lang="EN-US" style="FONT-SIZE: 10.5pt"><o:p><font face="Simsun">&#160;</font></o:p></span>
</p><img src="http://www.cnblogs.com/jeseeqing/aggbug/80161.html?type=1" width="1" height="1" alt=""/><p>评论: 10　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/21/80161.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/21/80161.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>Microsoft Encarta Reference Library体验</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/12/20/79375.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Mon, 20 Dec 2004 02:10:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/12/20/79375.html</guid><description><![CDATA[<p>阅读: 4351 评论: 8 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-12-20 10:10 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/20/79375.html" target="_blank">原文链接</a></p><p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><b style="mso-bidi-font-weight: normal"><span lang="EN-US" style="FONT-SIZE: 14pt"><font face="Times New Roman">Microsoft Encarta Reference Library</font></span></b><b style="mso-bidi-font-weight: normal"><span style="FONT-SIZE: 14pt; FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">体验</span></b><b style="mso-bidi-font-weight: normal"><span lang="EN-US" style="FONT-SIZE: 14pt"><o:p></o:p></span></b>
</p>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><font size="3"><span lang="EN-US"><span style="mso-tab-count: 1"><font face="Times New Roman">&#160;&#160;&#160;&#160;&#160;&#160; </font></span></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">早就听说过</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的大名，直到我将这个大块头买回来，总共</span><span lang="EN-US"><font face="Times New Roman">5</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">张光盘。</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">在金山词霸的翻译为&#8220;微软的电子百科全书&#8221;，安装完后总共占用了我硬盘</span><st1:chmetcnv w:st="on" TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="1.96" UnitName="g"><span lang="EN-US"><font face="Times New Roman">1.96G</font></span></st1:chmetcnv><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的空间，加上其它的总共需要</span><st1:chmetcnv w:st="on" TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="2" UnitName="g"><span lang="EN-US"><font face="Times New Roman">2G</font></span></st1:chmetcnv><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">多。</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><font size="3"><span lang="EN-US"><span style="mso-tab-count: 1"><font face="Times New Roman">&#160;&#160;&#160;&#160;&#160;&#160; </font></span></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">大概系统的结构从软件的角度来剖析的话，应有两大块，对应于两个目录：</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">1.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Microsoft Encarta Reference Library</font></span></font><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的启动程序，用于浏览内容，在安装目录下的</span><span lang="EN-US"><font face="Times New Roman">\Encarta Reference Library 2003</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">目录中；</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 42.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">2.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Microsoft Encarta</font></span></font><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的具体数据内容，所有电子数据存储于其中，在安装目录下的</span><span lang="EN-US"><font face="Times New Roman">2003 Contents</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">目录中，总共占</span><st1:chmetcnv w:st="on" TCSC="0" NumberType="1" Negative="False" HasSpace="False" SourceValue="1.5" UnitName="g"><span lang="EN-US"><font face="Times New Roman">1.5G</font></span></st1:chmetcnv><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">多。在这个目录下的文件多为扩展名为</span><span lang="EN-US"><font face="Times New Roman">ITS</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的文件；</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">像这么宠大的数据集，如果不使用数据库，又要非常快地搜索、显示，不知道其内部怎么实现。我在</span><span lang="EN-US"><font face="Times New Roman">\Encarta Reference Library 2003</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">目录下找到了一个名为</span><span lang="EN-US"><font face="Times New Roman">MINDMAZE.IDX</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的文件，大概是用于存储所有文件的索引数据吧。了解了大致的结构后，来启动一下</span><span lang="EN-US"><font face="Times New Roman">Microsoft Encarta Reference Library </font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">吧。</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">启动后主界面如下：</font></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><v:shapetype id="_x0000_t75"><v:stroke></v:stroke><v:formulas><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f><v:f></v:f></v:formulas><v:path></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;<img height="479" hspace="5" src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/EncatraMainUI.jpg" width="640" align="baseline" /></font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">里面共有九大类型的内容：</font></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">1.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Article Center</font></span></font><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">：文档中心，这里面有百科全书、全世界所有国家列表、文学作品、以及历史档案等。在历史档案中可以查到最近几十年中大部分国家的发展情况；</font></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">2.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Maps Center</font></span></font><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">：地图中心，有全世界所有的电子地图，可以精确到一个市，不过对于中国来说，都是用英文来描述每个城市，每个省份的。</font></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"></span>
</p>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><font size="3"><span lang="EN-US"><font face="Times New Roman"><img height="392" src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/EncatraMapChina.jpg" width="640" />Encarta Map Center</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">中的中国</span></font>
</p>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><span lang="EN-US"></span>
</p>
<p class="MsoNormal" align="center" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center"><font size="3"><span lang="EN-US"><font face="Times New Roman"><img height="479" src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/EncatraMapShenZhen.jpg" width="640" />Encarta Map Center</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">中的深圳，地图中居然有&#8220;蛇口&#8221;</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">3.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Homework Center</font></span></font><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">：可以作为一个很全面的教育课程及词典工具，里面有一些可以供小孩子学习的内容，不过只有美国和加拿大的；</font></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">4.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Multimedia Center</font></span></font><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">：包含了一些各地方的视频信息；</span><span lang="EN-US"><font face="Times New Roman"> </font></span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">5.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Timelines Center</font></span></font><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">：记载了每个每代的整个地球的大致情况，通过这个时代我们可以清晰地看到中国</span><span lang="EN-US"><font face="Times New Roman">5000</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">年的历史，从公元前</span><span lang="EN-US"><font face="Times New Roman">404</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">年中国周王朝开始中国这根时间线从来没有断过，在</span><span lang="EN-US"><font face="Times New Roman">BC271</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">这个年代整个东亚只有周朝，其它国家，从我的理解应是没有历史可以得到任何档案，所以没有出现在</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">中</span></font>
</p>
<p class="MsoNormal" align="right" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: right"><span lang="EN-US"></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;<img height="391" src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/EncatraTimeline267.jpg" width="640" /></font></o:p></span>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">以下为</span><span lang="EN-US"><font face="Times New Roman">1600</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">年中国处在明朝时整个东亚的大致情况，看到这我为中国悠久的历史而自豪。</span></font>
</p>
<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;<img height="464" src="http://www.cnblogs.com/images/cnblogs_com/jeseeqing/EncatraTimeline1600.jpg" width="640" /></font></o:p></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left"><span lang="EN-US"></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">至于近代史，那就不好说了。</font></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">6.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Tours Center</font></span></font><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">：这里面有</span><span lang="EN-US"><font face="Times New Roman">3D Virtual Tours</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">与</span><span lang="EN-US"><font face="Times New Roman"> 2D Virtual Tours</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">，通过对一些城市以</span><span lang="EN-US"><font face="Times New Roman">3D</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的方式虚拟出来，可惜这些城市中没有找到中国的，有古罗马、英国等的历史名城，可惜我计算机的显卡不是很好。</span><span lang="EN-US"><font face="Times New Roman">2D Virtual Tours</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">通过对一些城市以</span><span lang="EN-US"><font face="Times New Roman">2D</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">的方式虚拟出来，我在香港的</span><span lang="EN-US"><font face="Times New Roman">2D</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">虚拟方式中转了一圈，</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">在</span><span lang="EN-US"><font face="Times New Roman">2D</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">环境中以</span><span lang="EN-US"><font face="Times New Roman">360</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">度的角度对香港的各个地方进行了扫描，要是显卡好一点会看得更清楚。</span></font>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l1 level1 lfo2; tab-stops: list 21.0pt"><font face="Times New Roman"><span lang="EN-US" style="mso-fareast-font-family: &#39;Times New Roman&#39;"><span style="mso-list: Ignore"><font size="3">7.</font><span style="FONT: 7pt &#39;Times New Roman&#39;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></span><span lang="EN-US"><font size="3">Games Center</font></span></font><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;"><font size="3">：里面有一些智力测试游戏。</font></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left"><span lang="EN-US"><o:p><font face="Times New Roman" size="3">&#160;</font></o:p></span>
</p>
<p class="MsoNormal" align="left" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt; TEXT-ALIGN: left"><font size="3"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">除了这些内容外，</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">还提供了一些非常好的工具如：</span><span lang="EN-US"><font face="Times New Roman">Encarta Dictionary Tool</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">，</span><span lang="EN-US"><font face="Times New Roman">Encarta Researcher</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">。上面提了一些大概，</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">作为一个工具，里面还有很多精彩的部分等着你去挖掘，作为一个百科全书类的软件，</span><span lang="EN-US"><font face="Times New Roman">Encarta</font></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: &#39;Times New Roman&#39;; mso-hansi-font-family: &#39;Times New Roman&#39;">已经做得很不错了，有易用的界面及精彩的内容，是探索科学知识的必不可少的工具。</span></font>
</p><img src="http://www.cnblogs.com/jeseeqing/aggbug/79375.html?type=1" width="1" height="1" alt=""/><p>评论: 8　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/20/79375.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/20/79375.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>有个想法，博客圆能否建立一个wiki资源区</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/12/17/78286.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Fri, 17 Dec 2004 03:12:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/12/17/78286.html</guid><description><![CDATA[<p>阅读: 2414 评论: 20 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-12-17 11:12 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/17/78286.html" target="_blank">原文链接</a></p><p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">dudu</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">，博客圆的人气已经越来越旺了，很多领域的专家都在上面建立了自已的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">blog</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">。我建议</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">dudu</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">在博客圆中建立一个</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">wiki</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">资源区域，通过发挥各自的特长，建立一个协作的写作中心。我的想法具体如下：</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">1</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">、内容可以类似于</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><a href="http://en.wikipedia.org/wiki/Main_Page">wiki<span lang="EN-US" style="FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial"><span lang="EN-US">大百科</span></span></a></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">的形式或者</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><a href="http://wiki.csdn.net/">CSDN</a></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">的形式，或者博客圆自已的形式；</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">2</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">、可以采用开源项目</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><a href="http://www.flexwiki.com/"><font color="#800080">flexwiki</font></a></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">来构建这个环境；</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">3</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">、具体内容可以以专题的形式来组织，如</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">OO</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">技术、</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">XP</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">开发、开源技术，或者其它形式；</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">4</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">、再往后面想一点，以后博客圆可能有很多自已的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Blog</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">团队，如现在的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&#8220;<A href="http://www.cnblogs.com/team/DesignPattern.html"><font color="#800080">Design &amp; Pattern<span lang="EN-US" style="FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial"><span lang="EN-US">团队</span></span></font></a>&#8221;</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">，</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&#8220;<A href="http://www.cnblogs.com/team/Magazine.html"><span lang="EN-US" style="FONT-FAMILY: SimSun; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial"><span lang="EN-US"><font color="#800080">博客圆杂志制作小组</font></span></span></a>&#8221;</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">，需要维护自已本团队的手册，内容，知识库等，通过建设一个协作中心，更好地为团队服务，通过不断地修建，可以建成一个完善的知识中心；</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/>
<br/></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">以上只是一个想法，可能在实际的运作过程中，会有各种的困难，但是相信博客圆能够建立好一个成功的</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">wiki</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">区。</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/>
<br/></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">实际上随着</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">wiki</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">技术的推广，已经越来越来地出现在很多的团队中，可以设想在软件公司也可以采用</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">wiki</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">技术来构建自已的知识中心。就像</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">blog</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">技术的发展一样，</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">wiki</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">技术从理论、实现，现在已经走向了应用阶段。</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> </span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-fareast-language: ZH-TW">
<br/>
<br/></span><span style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun; mso-bidi-font-family: Arial; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial">暂时现放在首页两天，希望得到大家的响应。</span><span lang="EN-US" style="mso-fareast-language: ZH-TW"><o:p></o:p></span> 
</p><img src="http://www.cnblogs.com/jeseeqing/aggbug/78286.html?type=1" width="1" height="1" alt=""/><p>评论: 20　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/17/78286.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/12/17/78286.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>深圳，暂时向你告别</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/11/25/68423.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Thu, 25 Nov 2004 02:29:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/11/25/68423.html</guid><description><![CDATA[<p>阅读: 1376 评论: 7 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-11-25 10:29 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/25/68423.html" target="_blank">原文链接</a></p><P>&#160;&#160;&#160;&#160; 来深圳二年了，我的软件开发技术在深圳飞越，我的理想在深圳慢慢地变得可以预见。在深圳有着太多的像我这样的求索者，带着自已的理想来到了这片热土，为这片土地奉献着自已仅有的一点微薄之力。<br/><br/>&#160;&#160;&#160;&#160; 在深圳，让我知道了坐公交车原来可以享受星级的服务；<br/>&#160;&#160;&#160;&#160;&#160;在深圳，让我知道了纳税人的存在；<br/>&#160;&#160;&#160;&#160;&#160;在深圳，让我知道了做人多么需要善良的一面；<br/>&#160;&#160;&#160;&#160; 在深圳，让我知道了原来还有民主的存在；<br/>&#160;&#160;&#160;&#160; 在深圳，让我认识了很多知已；<br/>&#160;&#160;&#160;&#160; 在深圳，让我真正理解了“时间就是金钱”，“深圳速度”；<br/>&#160;&#160;&#160;&#160; 在深圳，让我有了自信，更让我坚信，我可以成功；<br/>&#160;&#160;&#160;&#160;&#160;......<br/>&#160;&#160;&#160;&#160;<br/>&#160;&#160;&#160;&#160;&#160;总之，有太多的理由让我喜欢深圳这个年轻、充满活力的城市。带着一种沉重的心情暂时告别深圳，开始我的另一段新的旅程。深圳你等着我吧，若干年之后，我还会杀回来的...... 
</P>
<P>&#160;&#160;&#160;&#160;&#160;今天是感恩节，我在此感谢我的家人，我的朋友，我的网友，感谢我的公司，所有帮助过我的人，所有关心我的人，所有浏览我的blog的人，谢谢你们。<br/>&#160;&#160;&#160; 祝感恩节快乐! 
</P><img src="http://www.cnblogs.com/jeseeqing/aggbug/68423.html?type=1" width="1" height="1" alt=""/><p>评论: 7　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/25/68423.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/25/68423.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>Exchange开发(六) ExchangeHelper类</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67458.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Tue, 23 Nov 2004 04:04:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67458.html</guid><description><![CDATA[<p>阅读: 4392 评论: 24 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-11-23 12:04 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67458.html" target="_blank">原文链接</a></p>在我的上一片文章中，我贴出了与帐号相关的ADHelper类，以下贴出了与Exchange部分操作相关的ExchangeHelper类
<br/>
<br/>
<div style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
   <div><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.ComponentModel.Design;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.DirectoryServices;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.Collections;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.Text;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.Diagnostics;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.Net;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;System.Runtime.InteropServices;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;MSXML2;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&#160;CDOEXM;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" />&#160;</span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000">&#160;ColourLife.ExchangeMail
<br/><img id="Codehighlighter1_274_5149_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_274_5149_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_274_5149_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_274_5149_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_274_5149_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_274_5149_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_274_5149_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_274_5149_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" style="DISPLAY: none" /></span><span id="Codehighlighter1_274_5149_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_274_5149_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_278_332_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_278_332_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_278_332_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_278_332_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_278_332_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_278_332_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_278_332_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_278_332_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160; </span><span id="Codehighlighter1_278_332_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;ExchangeMail&#160;的摘要说明。
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&#160;ExchangeAccount
<br/><img id="Codehighlighter1_364_5147_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_364_5147_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_364_5147_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_364_5147_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_364_5147_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_364_5147_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_364_5147_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_364_5147_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;</span><span id="Codehighlighter1_364_5147_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;EXCHANGE_NAME&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">Exchange</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;GetLocalDNSName()
<br/><img id="Codehighlighter1_461_528_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_461_528_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_461_528_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_461_528_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_461_528_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_461_528_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_461_528_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_461_528_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_461_528_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;Dns.GetHostByName(Environment.MachineName).HostName;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_535_810_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_535_810_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_535_810_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_535_810_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_535_810_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_535_810_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_535_810_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_535_810_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160; </span><span id="Codehighlighter1_535_810_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;校验指定的用户的Exchange账户及密码是否正确
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;useSSL&quot;&gt;</span><span style="COLOR: #008000">指示是否使用SSL</span><span style="COLOR: #808080">&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;serverName&quot;&gt;</span><span style="COLOR: #008000">Exchange&#160;Server的计算机名称</span><span style="COLOR: #808080">&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;userName&quot;&gt;</span><span style="COLOR: #008000">用户名</span><span style="COLOR: #808080">&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;password&quot;&gt;</span><span style="COLOR: #008000">密码</span><span style="COLOR: #808080">&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;returns&gt;&lt;/returns&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;HttpStatusCode&#160;AuthorizationAccount(</span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000">&#160;useSSL,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;serverName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;password)
<br/><img id="Codehighlighter1_928_1203_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_928_1203_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_928_1203_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_928_1203_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_928_1203_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_928_1203_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_928_1203_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_928_1203_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_928_1203_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_928_1203_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;MSXML2.IXMLHTTPRequest&#160;xmlHttp&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&#160;MSXML2.XMLHTTPClass();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;xmlHttp.open(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">GET</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">,GetUserExchangeURL(useSSL,serverName,userName),</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">,userName,password);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;xmlHttp.send(</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;(HttpStatusCode)Enum.Parse(</span><span style="COLOR: #0000ff">typeof</span><span style="COLOR: #000000">(HttpStatusCode),xmlHttp.status.ToString());
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;GetUserExchangeURL(</span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000">&#160;isUsingSSL,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;serverName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName)
<br/><img id="Codehighlighter1_1301_1577_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1301_1577_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_1301_1577_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_1301_1577_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_1301_1577_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1301_1577_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_1301_1577_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_1301_1577_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_1301_1577_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_1301_1577_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;StringBuilder&#160;urlBuilder&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&#160;StringBuilder();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;protocol&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;isUsingSSL&#160;</span><span style="COLOR: #000000">?</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">https://</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">&#160;:</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">http://</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">;&#160;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;urlBuilder.Append(protocol).Append(serverName).Append(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">).Append(EXCHANGE_NAME);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;urlBuilder.Append(</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">/</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">).Append(userName);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;urlBuilder.ToString();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;
<br/><img id="Codehighlighter1_1584_1807_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1584_1807_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_1584_1807_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_1584_1807_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_1584_1807_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1584_1807_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_1584_1807_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_1584_1807_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_1584_1807_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_1584_1807_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;创建Exchange账户到指定的用户组中，同时也创建了AD账户
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;userName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;password&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;organizeName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adGroup&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;DirectoryEntry&#160;CreateNewExchangeAccount(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;password,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;organizeName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adGroup)
<br/><img id="Codehighlighter1_1938_2028_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1938_2028_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_1938_2028_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_1938_2028_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_1938_2028_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_1938_2028_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_1938_2028_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_1938_2028_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_1938_2028_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_1938_2028_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;CreateNewExchangeAccount(</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,userName,password,organizeName,adGroup);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_2034_2349_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2034_2349_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_2034_2349_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_2034_2349_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_2034_2349_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2034_2349_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_2034_2349_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_2034_2349_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_2034_2349_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_2034_2349_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;使用指定的安全信息来创建Exchange账户到指定的用户组中，同时也创建了AD账户
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adminName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adminPassword&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;userName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;password&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;organizeName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adGroup&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;DirectoryEntry&#160;CreateNewExchangeAccount(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminPassword,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;password,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;organizeName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adGroup)
<br/><img id="Codehighlighter1_2518_3062_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2518_3062_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_2518_3062_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_2518_3062_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_2518_3062_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2518_3062_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_2518_3062_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_2518_3062_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_2518_3062_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_2518_3062_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">创建AD帐户</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /></span><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DirectoryEntry&#160;userEntry&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;ADHelper.CreateADAccount(adminName,adminPassword,userName,password,organizeName,adGroup);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">创建Exchange邮箱</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /></span><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CDOEXM.IMailboxStore&#160;mailbox&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;(CDOEXM.IMailboxStore)userEntry.NativeObject;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;machineName&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;Environment.MachineName;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mailbox.CreateMailbox(GetFirstStoreMDB(machineName,adminName,adminPassword));
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;userEntry.CommitChanges();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">&#160;(adGroup&#160;</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #000000">&amp;&amp;</span><span style="COLOR: #000000">&#160;adGroup.Length&#160;</span><span style="COLOR: #000000">&gt;</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">)
<br/><img id="Codehighlighter1_2960_3036_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2960_3036_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_2960_3036_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_2960_3036_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_2960_3036_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_2960_3036_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_2960_3036_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_2960_3036_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_2960_3036_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_2960_3036_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ADHelper.AddUserToGroup(adminName,adminPassword,userName,adGroup);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;userEntry;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_3070_3158_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_3070_3158_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_3070_3158_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_3070_3158_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_3070_3158_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_3070_3158_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_3070_3158_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_3070_3158_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_3070_3158_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_3070_3158_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;获取Exchange的第一个邮箱存储的LDAP路径
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;returns&gt;&lt;/returns&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;GetFirstStoreMDB(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;serverName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;password)
<br/><img id="Codehighlighter1_3253_4002_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_3253_4002_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_3253_4002_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_3253_4002_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_3253_4002_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_3253_4002_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_3253_4002_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_3253_4002_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_3253_4002_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_3253_4002_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CDOEXM.IExchangeServer&#160;exchangeServer&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&#160;CDOEXM.ExchangeServerClass();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CDOEXM.IStorageGroup&#160;storageGroup&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&#160;CDOEXM.StorageGroupClass();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">连接到指定的Exchange数据源</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /></span><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;exchangeServer.DataSource.Open(serverName,</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,ADODB.ConnectModeEnum.adModeRead,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ADODB.RecordCreateOptionsEnum.adFailIfNotExists,ADODB.RecordOpenOptionsEnum.adOpenAsync,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;userName,password);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">[]&#160;groups&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;exchangeServer.StorageGroups&#160;</span><span style="COLOR: #0000ff">as</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">[];
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;storageGroup.DataSource.Open(groups[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">].ToString(),</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,ADODB.ConnectModeEnum.adModeRead,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ADODB.RecordCreateOptionsEnum.adFailIfNotExists,ADODB.RecordOpenOptionsEnum.adOpenAsync,
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;userName,password);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">[]&#160;mailboxs&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;storageGroup.MailboxStoreDBs&#160;</span><span style="COLOR: #0000ff">as</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">[];
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;mailboxs[</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">].ToString();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;
<br/><img id="Codehighlighter1_4009_4097_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4009_4097_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4009_4097_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4009_4097_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4009_4097_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4009_4097_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4009_4097_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4009_4097_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4009_4097_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_4009_4097_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;获取Exchange的第一个邮箱存储的LDAP路径
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;returns&gt;&lt;/returns&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;GetFirstStoreMDB(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;serverName)
<br/><img id="Codehighlighter1_4160_4214_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4160_4214_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4160_4214_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4160_4214_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4160_4214_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4160_4214_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4160_4214_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4160_4214_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4160_4214_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_4160_4214_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&#160;GetFirstStoreMDB(serverName,</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">,</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_4219_4321_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4219_4321_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4219_4321_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4219_4321_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4219_4321_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4219_4321_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4219_4321_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4219_4321_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4219_4321_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_4219_4321_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;删除Exchange用户账户并同时删除AD账户
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;userName&quot;&gt;</span><span style="COLOR: #008000">用户名称</span><span style="COLOR: #808080">&lt;/param&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&#160;DeleteExchangeAccount(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminPassword,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName)
<br/><img id="Codehighlighter1_4422_4491_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4422_4491_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4422_4491_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4422_4491_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4422_4491_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4422_4491_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4422_4491_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4422_4491_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4422_4491_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_4422_4491_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DeleteExchangeAccount(adminName,adminPassword,userName,</span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img id="Codehighlighter1_4497_4723_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4497_4723_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4497_4723_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4497_4723_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4497_4723_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4497_4723_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4497_4723_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4497_4723_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4497_4723_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_4497_4723_Open_Text"><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;删除Exchange用户账户并指示是否同时删除AD账户
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;/summary&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adminName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;adminPassword&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;deleteADUser&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #808080">///</span><span style="COLOR: #008000">&#160;</span><span style="COLOR: #808080">&lt;param&#160;name=&quot;userName&quot;&gt;&lt;/param&gt;</span><span style="COLOR: #808080"></span></span>
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&#160;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&#160;DeleteExchangeAccount(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminName,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;adminPassword,</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&#160;userName,</span><span style="COLOR: #0000ff">bool</span><span style="COLOR: #000000">&#160;deleteADUser)
<br/><img id="Codehighlighter1_4842_5144_Open_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4842_5144_Open_Text.style.display=&#39;none&#39;; Codehighlighter1_4842_5144_Closed_Image.style.display=&#39;inline&#39;; Codehighlighter1_4842_5144_Closed_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" width="11" align="top" /><img id="Codehighlighter1_4842_5144_Closed_Image" onclick="this.style.display=&#39;none&#39;; Codehighlighter1_4842_5144_Closed_Text.style.display=&#39;none&#39;; Codehighlighter1_4842_5144_Open_Image.style.display=&#39;inline&#39;; Codehighlighter1_4842_5144_Open_Text.style.display=&#39;inline&#39;;" height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" width="11" align="top" style="DISPLAY: none" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span id="Codehighlighter1_4842_5144_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 height="20" src="http://www.cnblogs.com/Images/dot.gif" width="15" /></span><span id="Codehighlighter1_4842_5144_Open_Text"><span style="COLOR: #000000">{
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;DirectoryEntry&#160;user&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;ADHelper.FindObject(adminName,adminPassword,</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">user</span><span style="COLOR: #000000">&quot;</span><span style="COLOR: #000000">,userName);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">删除Exchange邮箱</span><span style="COLOR: #008000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" /></span><span style="COLOR: #000000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CDOEXM.IMailboxStore&#160;mailbox&#160;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&#160;(CDOEXM.IMailboxStore)user.NativeObject;
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mailbox.DeleteMailbox();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;user.CommitChanges();
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ADHelper.DeleteADAccount(adminName,adminPassword,userName);
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" width="11" align="top" />&#160;&#160;&#160;&#160;}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" width="11" align="top" />}</span></span><span style="COLOR: #000000">
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" />
<br/><img height="16" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" width="11" align="top" /></span>
   </div>
</div>&#160;&#160; 
<p style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: SimSun; mso-outline-level: 1">&#160; </p>
<p style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: SimSun; mso-outline-level: 1">在以上类中需要引用ADHelper类，有关ADHelper类请参考</p>
<p style="MARGIN: 0in; mso-outline-level: 1"><span lang="ZH-CN" style="FONT-WEIGHT: bold; FONT-SIZE: 9.75pt; FONT-FAMILY: Verdana">Exchange开发(五) ADHelper类 </span><span lang="EN-US" style="FONT-WEIGHT: bold; FONT-SIZE: 9.75pt; FONT-FAMILY: Verdana"><span style="mso-spacerun: yes">&#160;</span></span><A href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html"><span lang="ZH-CN" style="FONT-SIZE: 10pt; FONT-FAMILY: SimSun">http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html</span></a> 
</p><img src="http://www.cnblogs.com/jeseeqing/aggbug/67458.html?type=1" width="1" height="1" alt=""/><p>评论: 24　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67458.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67458.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item><item><title>Exchange开发(五) ADHelper类</title><link>http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html</link><dc:creator>jeseeqing</dc:creator><author>jeseeqing</author><pubDate>Tue, 23 Nov 2004 03:45:00 GMT</pubDate><guid>http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html</guid><description><![CDATA[<p>阅读: 2824 评论: 3 作者: <a href="http://www.cnblogs.com/jeseeqing/" target="_blank">jeseeqing</a> 发表于 2004-11-23 11:45 <a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html" target="_blank">原文链接</a></p><P>由于Exchange与AD实现了无缝的集成，所以某些对Exchange的开发实际上也是对AD的开发，以下是我在开发过程中的ADHelper类，主要完成AD操作的某些基本功能 <BR><BR>在博客堂的<A class=HeaderMainTitle id=Header1_HeaderTitle href="http://blog.joycode.com/liuhuimiao/">Think Different and Think More</A>的blog的文章&nbsp;<A href="http://blog.joycode.com/liuhuimiao/articles/20946.aspx">http://blog.joycode.com/liuhuimiao/articles/20946.aspx</A>&nbsp; 中有一个ADHelper类，另外在Rainbow中也有一个ADHelper类 </P>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: SimSun; mso-outline-level: 1">&nbsp;</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"><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.DirectoryServices;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Net;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text;<BR></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;CDOEXM;<BR><BR></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;ExchangeMailTest<BR>{<BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;实现AD操作的一些常用功能<BR>&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"><BR></SPAN><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;ADHelper<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&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">const</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;LDAP_IDENTITY&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">LDAP://</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateADAccount</SPAN><SPAN style="COLOR: #000000"><BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;CreateADAccount(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateADAccount(userName,password,organizeName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Empty);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;CreateADAccount(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adGroup)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateADAccount(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,userName,password,organizeName,adGroup);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;CreateADAccount(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adGroup)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;entry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(adminName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;entry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetOrganizeNamePath(organizeName));<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>&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;entry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetOrganizeNamePath(organizeName),adminName,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adminPassword,AuthenticationTypes.Secure);<BR>&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;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">增加用户到AD域中</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;user&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;entry.Children.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">CN=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">sAMAccountName</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Add(userName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.CommitChanges();<BR>&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></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SetPassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[]{password});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">userAccountControl</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0x200</SPAN><SPAN style="COLOR: #000000">;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.CommitChanges();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;user;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDomainPath()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;(DirectoryEntry&nbsp;root&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry())<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;root.Path;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;FindObject(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;category,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;FindObject(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,category,name);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;FindObject(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;category,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;de&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(adminName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;de&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetDomainPath(),adminName,adminPassword,AuthenticationTypes.Secure);<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>&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;de&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectorySearcher&nbsp;ds&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectorySearcher(de);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;queryFilter&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Format(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">(&amp;(objectCategory=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;category&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">)(sAMAccountName={0}))</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;name);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ds.Filter&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;queryFilter;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ds.Sort.PropertyName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">cn</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;userEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>&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;SearchResult&nbsp;sr&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ds.FindOne();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;sr.GetDirectoryEntry();<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN style="COLOR: #000000"><BR>&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;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(de&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;de.Dispose();<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(ds&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;ds.Dispose();<BR>&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;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;userEntry;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;改变AD用户信息，删除AD帐户</SPAN><SPAN style="COLOR: #000000"><BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;RenameUser(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminUser,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;oldUserName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;newUserName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;userEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FindObject(adminUser,adminPassword,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,oldUserName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userEntry.Rename(newUserName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userEntry.CommitChanges();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;SetUserPassword(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetUserPassword(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,userName,password);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;SetUserPassword(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;password)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;userEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FindObject(adminName,adminPassword,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,userName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userEntry.Invoke(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SetPassword</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">[]{password});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userEntry.CommitChanges();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;删除AD账户，使用当前上下文的安全信息，一般用于Windows程序<BR>&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: #008000"><BR>&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;param&nbsp;name="userName"&gt;</SPAN><SPAN style="COLOR: #008000">用户名称</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;DeleteADAccount(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DeleteADAccount(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,userName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;删除AD账户，使用指定的用户名和密码来模拟，一般用于ASP.NET程序<BR>&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: #008000"><BR>&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;param&nbsp;name="adminUser"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="adminPassword"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="userName"&gt;</SPAN><SPAN style="COLOR: #008000">用户名称</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;DeleteADAccount(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminUser,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;user&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FindObject(adminUser,adminPassword,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,userName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.Children.Remove(user);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.CommitChanges();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;与OU及组有关的操作</SPAN><SPAN style="COLOR: #000000"><BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;创建OU，需要指定连接到AD的授权信息，一般用于ASPNET程序<BR>&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: #008000"><BR>&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;param&nbsp;name="adminName"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="adminPassword"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="name"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="parentOrganizeUnit"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;CreateOrganizeUnit(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;parentOrganizeUnit)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;parentEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(adminName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;parentEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetOrganizeNamePath(parentOrganizeUnit));<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>&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;parentEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetOrganizeNamePath(parentOrganizeUnit),adminName,adminPassword,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AuthenticationTypes.Secure);<BR>&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;DirectoryEntry&nbsp;organizeEntry&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;parentEntry.Children.Add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">OU=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;name,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">organizationalUnit</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;organizeEntry.CommitChanges();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">parentEntry.CommitChanges();</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeEntry;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;创建OU，不需要指定连接到AD的授权信息，用于Windows程序<BR>&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: #008000"><BR>&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;param&nbsp;name="name"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="parentOrganizeUnit"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry&nbsp;CreateOrganizeUnit(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;name,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;parentOrganizeUnit)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;CreateOrganizeUnit(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,name,parentOrganizeUnit);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;将用户加入到用户组中<BR>&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: #008000"><BR>&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;param&nbsp;name="userName"&gt;</SPAN><SPAN style="COLOR: #008000">用户名</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="organizeName"&gt;</SPAN><SPAN style="COLOR: #008000">组织名</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="groupName"&gt;</SPAN><SPAN style="COLOR: #008000">组名</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;exception&nbsp;cref="InvalidObjectException"&gt;</SPAN><SPAN style="COLOR: #008000">用户名或用户组不存在</SPAN><SPAN style="COLOR: #808080">&lt;/exception&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;AddUserToGroup(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;groupName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AddUserToGroup(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">,userName,groupName);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;将用户加入到用户组中<BR>&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: #008000"><BR>&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;param&nbsp;name="adminName"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="adminPassword"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="userName"&gt;</SPAN><SPAN style="COLOR: #008000">用户名</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="groupName"&gt;</SPAN><SPAN style="COLOR: #008000">组名</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;exception&nbsp;cref="InvalidObjectException"&gt;</SPAN><SPAN style="COLOR: #008000">用户名或用户组不存在</SPAN><SPAN style="COLOR: #808080">&lt;/exception&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;AddUserToGroup(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;groupName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;rootUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(adminName&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">||</SPAN><SPAN style="COLOR: #000000">&nbsp;adminPassword&nbsp;</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">)<BR>&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;rootUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetUserPath(),adminName,adminPassword,AuthenticationTypes.Secure);<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR>&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;rootUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry(GetUserPath());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;group&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;user&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>&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;group&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;rootUser.Children.Find(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">CN=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;groupName);<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(Exception)<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;InvalidObjectException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">在域中不存在组&#8220;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;groupName&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&#8221;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000"><BR>&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;user&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;FindObject(adminName,adminPassword,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">user</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,userName);<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(Exception)<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;InvalidObjectException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">在域中不存在用户&#8220;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;userName&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&#8221;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">member</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Add(user.Properties[</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">distinguishedName</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">].Value);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group.CommitChanges();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;Method&nbsp;与AD的DN解析有关</SPAN><SPAN style="COLOR: #000000"><BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;获取所有用户所在的安全组<BR>&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: #008000"><BR>&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;returns&gt;&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetUserPath()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;GetUserPath(</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;获取所有没有在AD组织中的用户DN名称<BR>&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: #008000"><BR>&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;param&nbsp;name="userName"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;returns&gt;&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetUserPath(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&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();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(LDAP_IDENTITY);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(userName&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;userName.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)<BR>&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;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">CN=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).Append(userName).Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&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;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">CN=Users,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).Append(GetDomainDN());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;sb.ToString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;根据用户所在的组织结构来构造用户在AD中的DN路径<BR>&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: #008000"><BR>&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;param&nbsp;name="userName"&gt;</SPAN><SPAN style="COLOR: #008000">用户名称</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;param&nbsp;name="organzieName"&gt;</SPAN><SPAN style="COLOR: #008000">组织结构</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;returns&gt;&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetUserPath(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName,</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organzieName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&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();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(LDAP_IDENTITY);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">CN=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).Append(userName).Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).Append(SplitOrganizeNameToDN(organzieName));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;sb.ToString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;获取域的后缀DN名,如域为ExchangeTest.com,则返回"DC=ExchangeTest,DC=Com"<BR>&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: #008000"><BR>&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;returns&gt;&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetDomainDN()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;"DC=ExchangeTest,DC=Com";<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//<BR></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DirectoryEntry&nbsp;domain&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;DirectoryEntry();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;domain.Name;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;GetOrganizeNamePath(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeUnit)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&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();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.Append(LDAP_IDENTITY);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;sb.Append(SplitOrganizeNameToDN(organizeUnit)).ToString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;<BR><BR>&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: #008000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;分离组织名称为标准AD的DN名称,各个组织级别以"/"或"\"分开。如"总部/物业公司/小区"，并且当前域为<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;ExchangeTest.Com，则返回的AD的DN表示名为"OU=小区,OU=物业公司,OU=总&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;部,DC=ExchangeTest,DC=Com"。&nbsp;<BR>&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: #008000"><BR>&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;param&nbsp;name="organizeName"&gt;</SPAN><SPAN style="COLOR: #008000">组织名称</SPAN><SPAN style="COLOR: #808080">&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR>&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;returns&gt;</SPAN><SPAN style="COLOR: #008000">返回一个级别</SPAN><SPAN style="COLOR: #808080">&lt;/returns&gt;</SPAN><SPAN style="COLOR: #808080"><BR></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">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;SplitOrganizeNameToDN(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&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();<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(organizeName&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">&amp;&amp;</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">[]&nbsp;allOu&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;organizeName.Split(</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: #000000">'</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">\\</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">});<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><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;allOu.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">;&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;&nbsp;i</SPAN><SPAN style="COLOR: #000000">--</SPAN><SPAN style="COLOR: #000000">)<BR>&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;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;ou&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;allOu[i];<BR>&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;(sb.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">&nbsp;)<BR>&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;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&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;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">OU=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).Append(ou);<BR>&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;}<BR><BR>&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></SPAN><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;(sb.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">)<BR>&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;sb.Append(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR>&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;sb.Append(GetDomainDN());<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;sb.ToString();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN><SPAN style="COLOR: #000000"><BR>&nbsp;&nbsp;&nbsp;&nbsp;}<BR>}&nbsp;<BR><BR></SPAN></DIV>
<P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: SimSun; mso-outline-level: 1"><BR>以上代码会有一些异常需要自已定义 </P><img src="http://www.cnblogs.com/jeseeqing/aggbug/67438.html?type=1" width="1" height="1" alt=""/><p>评论: 3　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html#pagedcomment" target="_blank">查看评论</a>　<a href="http://www.cnblogs.com/jeseeqing/archive/2004/11/23/67438.html#commentform" target="_blank">发表评论</a></p><p><a href="http://job.cnblogs.com/" target="_blank">找优秀程序员，就在博客园</a></p><hr/><p>最新新闻：<br/>· <a href="http://news.cnblogs.com/n/59391/" target="_blank">Java之父称Java归属Oracle好过落在IBM手中</a><span style="color:gray">(2010-03-22 20:13)</span><br/>· <a href="http://news.cnblogs.com/n/59390/" target="_blank">柳传志:联想已投资电子书项目&quot;E人E本&quot;</a><span style="color:gray">(2010-03-22 18:42)</span><br/>· <a href="http://news.cnblogs.com/n/59389/" target="_blank">百度李彦宏回应高管相继离职：未必会找继任者</a><span style="color:gray">(2010-03-22 18:09)</span><br/>· <a href="http://news.cnblogs.com/n/59386/" target="_blank">Firefox 3.6曝高危漏洞 Mozilla月底修复</a><span style="color:gray">(2010-03-22 17:40)</span><br/>· <a href="http://news.cnblogs.com/n/59385/" target="_blank">联想集团宣布任命David Roman为高级副总裁</a><span style="color:gray">(2010-03-22 17:31)</span><br/></p><p>编辑推荐：<a href="http://news.cnblogs.com/n/59293/" target="_blank">五个广泛流传的对大龄程序员的误解</a><br/></p><p>网站导航：<a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/" target="_blank">个人主页</a>&nbsp;&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/ing/" target="_blank">闪存</a>&nbsp;&nbsp;<a href="http://home.cnblogs.com/group/" target="_blank">小组</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com/q/" target="_blank">博问</a>&nbsp;&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;&nbsp;<a href="http://kb.cnblogs.com" target="_blank">知识库</a></p>]]></description></item></channel></rss>