﻿<?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>博客园-代码描述人生</title><link>http://www.cnblogs.com/dahuaidan410/</link><description>.NET 相关技术 (大坏蛋的blog)</description><language>zh-cn</language><lastBuildDate>Mon, 13 Oct 2008 11:54:07 GMT</lastBuildDate><pubDate>Mon, 13 Oct 2008 11:54:07 GMT</pubDate><ttl>60</ttl><item><title>.NET 平台优秀控件及源代码介绍(一)</title><link>http://www.cnblogs.com/dahuaidan410/archive/2006/12/19/597282.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Tue, 19 Dec 2006 14:37:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2006/12/19/597282.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/597282.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2006/12/19/597282.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/597282.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/597282.html</trackback:ping><description><![CDATA[摘要: &nbsp;&nbsp;<a href='http://www.cnblogs.com/dahuaidan410/archive/2006/12/19/597282.html'>阅读全文</a><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/597282.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42969/" target="_blank">[新闻]MySpace推自助广告平台MyAds</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>灯神</title><link>http://www.cnblogs.com/dahuaidan410/archive/2005/11/28/286181.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Mon, 28 Nov 2005 08:00:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2005/11/28/286181.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/286181.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2005/11/28/286181.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/286181.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/286181.html</trackback:ping><description><![CDATA[志明和丽文是一对夫妻，他们的收入不高，但是喜欢上了高尔夫球。 <BR>有一天，他们带上球杆和几个球找地方去练习。最后找到了一个高级住宅区的 <BR>草坪，周围都是别墅。他们看一下周围没有物业管理的人，就在这片草坪上练习起 <BR>来。天有不测风云，丽文在练习挥杆的时候，球杆不慎脱手，打碎了一扇窗子然后 <BR>掉进去了。 <BR>他们两个急忙跑到那户人家，发现大门是虚掩的，他们就推门走进去。一进门 <BR>就看见碎掉的窗子，窗子旁边还有一个好像是古玩的琉璃灯也碎在地上，一个穿着 <BR>金黄色睡袍的微胖的留着长发的中年男人在一侧的沙发上坐着抽雪茄。 <BR>志明和丽文马上走上前去，正要对那个男人说道歉，男人先开口说话了：&#8220;你们 <BR>不要怕，其实我是灯神，&#8221;男人一指那个碎掉的琉璃灯，&#8220;我被困在那个灯里面已经 <BR>一千多年了，今天你们打破了灯，把我放了出来，因此我决定报答你们，满足你们三 <BR>个愿望。&#8221; <BR>志明和丽文面面相觑，过了半分钟，志明才小声说：&#8220;我想要一辆法拉利! 跑 <BR>车。&#8221;灯神很干脆的说：&#8220;你已经有了，法拉利公司会在48小时内把车交给你。&#8221;志 <BR>明一下欣喜若狂，但是马上安静下来，和丽文窃窃私语了几分钟后，又说：&#8220;我要在全世 <BR>界的每个银行里面都有1个亿美元的存款。&#8221;灯神沉思一下说：&#8220;我大致算了一下，你 <BR>现在的身家已经超过140亿美元了。&#8221;志明和丽文疯狂拥抱，庆祝他们的好运气。灯神 <BR>说：&#8220;还有一个愿望，快说吧。&#8221; <BR>丽文不等志明开口，就抢着说：&#8220;我要在全世界每一个名胜风景区都拥有一套大 <BR>房子。&#8221;灯神爽快的说：&#8220;这个简单，你已经拥有了。&#8221; <BR>志明和丽文更是又笑又跳，乐不可支。这时灯神说话了：&#8220;我满足了你们三个愿 <BR>望，你们也要满足我一个愿望。否则刚才的三个愿望就不能实现了。&#8221; <BR>志明和丽文紧张起来，心里想会不会拿走他们的灵魂之类。灯神说：&#8220;我的愿望 <BR>很简单，&#8221;他抬手指一下丽文，&#8220;只要你和我上一次床就可以了。&#8221; <BR>志明和丽文权衡再三，觉得没什么吃亏的，就答应他了。于是志明在楼下客厅 <BR>等待，灯神和丽文到二楼客厅&#8220;办事&#8221;。 <BR>事毕，灯神在床上点燃了一支雪茄，看着身材曼妙面容姣好! 的丽文欢欢喜喜的 <BR>穿衣服，问道：&#8220;你们两个都多大了？&#8221; <BR>丽文答：&#8220;我31岁，他33岁了。&#8221; <BR>灯神说：&#8220;都三十多岁的人了，居然还会相信有灯神！&#8221;<img src ="http://www.cnblogs.com/dahuaidan410/aggbug/286181.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42960/" target="_blank">[新闻]Facebook创始人:信息共享或存摩尔定律</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>终于轻松下来了</title><link>http://www.cnblogs.com/dahuaidan410/archive/2005/03/04/113074.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Fri, 04 Mar 2005 09:17:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2005/03/04/113074.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/113074.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2005/03/04/113074.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/113074.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/113074.html</trackback:ping><description><![CDATA[最近忙于一个项目，今天总算通过测试了，想起好久没有更新我的BLOG,让关心我的人失望了，接下来我会总结一下这段时间的工作，把技术心得与大家共享。<img src ="http://www.cnblogs.com/dahuaidan410/aggbug/113074.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42959/" target="_blank">[新闻]微软承认Vista用户账户控制功能有问题</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>如何扮演另一个帐号(C#实现)</title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/10/27/57471.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Wed, 27 Oct 2004 12:22:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/10/27/57471.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/57471.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/10/27/57471.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/57471.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/57471.html</trackback:ping><description><![CDATA[<P>&nbsp;</P>
<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 id=Codehighlighter1_0_158_Closed_Image onclick="this.style.display='none'; Codehighlighter1_0_158_Closed_Text.style.display='none'; Codehighlighter1_0_158_Open_Image.style.display='inline'; Codehighlighter1_0_158_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><IMG id=Codehighlighter1_0_158_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_158_Open_Text.style.display='none'; Codehighlighter1_0_158_Closed_Image.style.display='inline'; Codehighlighter1_0_158_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><SPAN id=Codehighlighter1_0_158_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">Using&nbsp;directives</SPAN><SPAN id=Codehighlighter1_0_158_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;Using&nbsp;directives</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Security.Principal;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Runtime.InteropServices;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text.RegularExpressions;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;Impersonal<BR><IMG id=Codehighlighter1_182_3872_Open_Image onclick="this.style.display='none'; Codehighlighter1_182_3872_Open_Text.style.display='none'; Codehighlighter1_182_3872_Closed_Image.style.display='inline'; Codehighlighter1_182_3872_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_182_3872_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_182_3872_Closed_Text.style.display='none'; Codehighlighter1_182_3872_Open_Image.style.display='inline'; Codehighlighter1_182_3872_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_182_3872_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_182_3872_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;Program<BR><IMG id=Codehighlighter1_206_3870_Open_Image onclick="this.style.display='none'; Codehighlighter1_206_3870_Open_Text.style.display='none'; Codehighlighter1_206_3870_Closed_Image.style.display='inline'; Codehighlighter1_206_3870_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_206_3870_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_206_3870_Closed_Text.style.display='none'; Codehighlighter1_206_3870_Open_Image.style.display='inline'; Codehighlighter1_206_3870_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_206_3870_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_206_3870_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_216_754_Closed_Image onclick="this.style.display='none'; Codehighlighter1_216_754_Closed_Text.style.display='none'; Codehighlighter1_216_754_Open_Image.style.display='inline'; Codehighlighter1_216_754_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top><IMG id=Codehighlighter1_216_754_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_216_754_Open_Text.style.display='none'; Codehighlighter1_216_754_Closed_Image.style.display='inline'; Codehighlighter1_216_754_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_216_754_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">测试代码</SPAN><SPAN id=Codehighlighter1_216_754_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;测试代码</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">[]&nbsp;args)<BR><IMG id=Codehighlighter1_284_594_Open_Image onclick="this.style.display='none'; Codehighlighter1_284_594_Open_Text.style.display='none'; Codehighlighter1_284_594_Closed_Image.style.display='inline'; Codehighlighter1_284_594_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_284_594_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_284_594_Closed_Text.style.display='none'; Codehighlighter1_284_594_Open_Image.style.display='inline'; Codehighlighter1_284_594_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_284_594_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_284_594_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">当前用户是:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;WindowsIdentity.GetCurrent().Name);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ImpersonatedWork&nbsp;testDel&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ImpersonatedWork(Test);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ImpersonateAndDo(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">epro\\liping</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">88888888</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;testDel);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">当前用户是:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;WindowsIdentity.GetCurrent().Name);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Test()<BR><IMG id=Codehighlighter1_631_735_Open_Image onclick="this.style.display='none'; Codehighlighter1_631_735_Open_Text.style.display='none'; Codehighlighter1_631_735_Closed_Image.style.display='inline'; Codehighlighter1_631_735_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_631_735_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_631_735_Closed_Text.style.display='none'; Codehighlighter1_631_735_Open_Image.style.display='inline'; Codehighlighter1_631_735_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_631_735_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_631_735_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">当前用户是:&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">&nbsp;WindowsIdentity.GetCurrent().Name);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DllImport(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">advapi32.dll</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;SetLastError&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">)]<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extern</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;LogonUser(String&nbsp;lpszUsername,&nbsp;String&nbsp;lpszDomain,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;lpszPassword,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;dwLogonType,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;dwLogonProvider,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ref</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr&nbsp;phToken);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DllImport(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">kernel32.dll</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;CharSet&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;CharSet.Auto)]<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extern</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;CloseHandle(IntPtr&nbsp;handle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[DllImport(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">advapi32.dll</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;CharSet&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;CharSet.Auto,&nbsp;SetLastError&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">)]<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">extern</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;DuplicateToken(IntPtr&nbsp;ExistingTokenHandle,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;SECURITY_IMPERSONATION_LEVEL,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ref</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr&nbsp;DuplicateTokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">delegate</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;ImpersonatedWork();<BR><IMG id=Codehighlighter1_1422_1612_Open_Image onclick="this.style.display='none'; Codehighlighter1_1422_1612_Open_Text.style.display='none'; Codehighlighter1_1422_1612_Closed_Image.style.display='inline'; Codehighlighter1_1422_1612_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1422_1612_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1422_1612_Closed_Text.style.display='none'; Codehighlighter1_1422_1612_Open_Image.style.display='inline'; Codehighlighter1_1422_1612_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1422_1612_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_1422_1612_Open_Text><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;以指定用户的身份去做一件事情<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;/summary&gt;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="UserName"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="PWD"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #808080">///</SPAN><SPAN style="COLOR: #008000">&nbsp;</SPAN><SPAN style="COLOR: #808080">&lt;param&nbsp;name="WhatToDo"&gt;&lt;/param&gt;</SPAN><SPAN style="COLOR: #808080"></SPAN></SPAN><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><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;ImpersonateAndDo(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;UserName,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;PWD,&nbsp;ImpersonatedWork&nbsp;WhatToDo)<BR><IMG id=Codehighlighter1_1721_3864_Open_Image onclick="this.style.display='none'; Codehighlighter1_1721_3864_Open_Text.style.display='none'; Codehighlighter1_1721_3864_Closed_Image.style.display='inline'; Codehighlighter1_1721_3864_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1721_3864_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1721_3864_Closed_Text.style.display='none'; Codehighlighter1_1721_3864_Open_Image.style.display='inline'; Codehighlighter1_1721_3864_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1721_3864_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1721_3864_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_1735_3428_Closed_Image onclick="this.style.display='none'; Codehighlighter1_1735_3428_Closed_Text.style.display='none'; Codehighlighter1_1735_3428_Open_Image.style.display='inline'; Codehighlighter1_1735_3428_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top><IMG id=Codehighlighter1_1735_3428_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1735_3428_Open_Text.style.display='none'; Codehighlighter1_1735_3428_Closed_Image.style.display='inline'; Codehighlighter1_1735_3428_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_1735_3428_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">扮演用户</SPAN><SPAN id=Codehighlighter1_1735_3428_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;扮演用户</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;domainName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Empty;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;userName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">.Empty;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntPtr&nbsp;tokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr(</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IntPtr&nbsp;dupeTokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr(</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;LOGON32_PROVIDER_DEFAULT&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;LOGON32_LOGON_INTERACTIVE&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;SecurityImpersonation&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">&nbsp;Regex.IsMatch(UserName,&nbsp;</SPAN><SPAN style="COLOR: #000000">@"</SPAN><SPAN style="COLOR: #000000">^\w+[\\]?\w+$</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">))<BR><IMG id=Codehighlighter1_2169_2241_Open_Image onclick="this.style.display='none'; Codehighlighter1_2169_2241_Open_Text.style.display='none'; Codehighlighter1_2169_2241_Closed_Image.style.display='inline'; Codehighlighter1_2169_2241_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2169_2241_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2169_2241_Closed_Text.style.display='none'; Codehighlighter1_2169_2241_Open_Image.style.display='inline'; Codehighlighter1_2169_2241_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2169_2241_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2169_2241_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ApplicationException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">非法的用户名</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_2296_2305_Open_Image onclick="this.style.display='none'; Codehighlighter1_2296_2305_Open_Text.style.display='none'; Codehighlighter1_2296_2305_Closed_Image.style.display='inline'; Codehighlighter1_2296_2305_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2296_2305_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2296_2305_Closed_Text.style.display='none'; Codehighlighter1_2296_2305_Open_Image.style.display='inline'; Codehighlighter1_2296_2305_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">[]&nbsp;tmp&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;UserName.Split(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">[]&nbsp;</SPAN><SPAN id=Codehighlighter1_2296_2305_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2296_2305_Open_Text><SPAN style="COLOR: #000000">{&nbsp;</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">\\</SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(tmp.Length&nbsp;</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_2353_2439_Open_Image onclick="this.style.display='none'; Codehighlighter1_2353_2439_Open_Text.style.display='none'; Codehighlighter1_2353_2439_Closed_Image.style.display='inline'; Codehighlighter1_2353_2439_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2353_2439_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2353_2439_Closed_Text.style.display='none'; Codehighlighter1_2353_2439_Open_Image.style.display='inline'; Codehighlighter1_2353_2439_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2353_2439_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2353_2439_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domainName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;tmp[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">];<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;tmp[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">];<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">else</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_2470_2519_Open_Image onclick="this.style.display='none'; Codehighlighter1_2470_2519_Open_Text.style.display='none'; Codehighlighter1_2470_2519_Closed_Image.style.display='inline'; Codehighlighter1_2470_2519_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2470_2519_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2470_2519_Closed_Text.style.display='none'; Codehighlighter1_2470_2519_Open_Image.style.display='inline'; Codehighlighter1_2470_2519_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2470_2519_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2470_2519_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;userName&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;tmp[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">];<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr.Zero;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dupeTokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr.Zero;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;returnValue&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;LogonUser(userName,domainName,&nbsp;&nbsp;PWD,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LOGON32_LOGON_INTERACTIVE,&nbsp;LOGON32_PROVIDER_DEFAULT,<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ref</SPAN><SPAN style="COLOR: #000000">&nbsp;tokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">returnValue)<BR><IMG id=Codehighlighter1_2816_2893_Open_Image onclick="this.style.display='none'; Codehighlighter1_2816_2893_Open_Text.style.display='none'; Codehighlighter1_2816_2893_Closed_Image.style.display='inline'; Codehighlighter1_2816_2893_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_2816_2893_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2816_2893_Closed_Text.style.display='none'; Codehighlighter1_2816_2893_Open_Image.style.display='inline'; Codehighlighter1_2816_2893_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_2816_2893_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2816_2893_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ApplicationException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">取Handle出错了!</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">Console.WriteLine("当前用户是:&nbsp;"<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;WindowsIdentity.GetCurrent().Name);</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000">&nbsp;retVal&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;DuplicateToken(tokenHandle,&nbsp;SecurityImpersonation,&nbsp;</SPAN><SPAN style="COLOR: #0000ff">ref</SPAN><SPAN style="COLOR: #000000">&nbsp;dupeTokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">retVal)<BR><IMG id=Codehighlighter1_3131_3251_Open_Image onclick="this.style.display='none'; Codehighlighter1_3131_3251_Open_Text.style.display='none'; Codehighlighter1_3131_3251_Closed_Image.style.display='inline'; Codehighlighter1_3131_3251_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_3131_3251_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_3131_3251_Closed_Text.style.display='none'; Codehighlighter1_3131_3251_Open_Image.style.display='inline'; Codehighlighter1_3131_3251_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_3131_3251_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_3131_3251_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CloseHandle(tokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">throw</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ApplicationException(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">复制Handle出错了!</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WindowsIdentity&nbsp;newId&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;WindowsIdentity(dupeTokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WindowsImpersonationContext&nbsp;impersonatedUser&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;newId.Impersonate();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_3442_3504_Closed_Image onclick="this.style.display='none'; Codehighlighter1_3442_3504_Closed_Text.style.display='none'; Codehighlighter1_3442_3504_Open_Image.style.display='inline'; Codehighlighter1_3442_3504_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top><IMG id=Codehighlighter1_3442_3504_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_3442_3504_Open_Text.style.display='none'; Codehighlighter1_3442_3504_Closed_Image.style.display='inline'; Codehighlighter1_3442_3504_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_3442_3504_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">以新用户身份调用</SPAN><SPAN id=Codehighlighter1_3442_3504_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;以新用户身份调用</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WhatToDo();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_3518_3854_Closed_Image onclick="this.style.display='none'; Codehighlighter1_3518_3854_Closed_Text.style.display='none'; Codehighlighter1_3518_3854_Open_Image.style.display='inline'; Codehighlighter1_3518_3854_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top><IMG id=Codehighlighter1_3518_3854_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_3518_3854_Open_Text.style.display='none'; Codehighlighter1_3518_3854_Closed_Image.style.display='inline'; Codehighlighter1_3518_3854_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_3518_3854_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">取消扮演</SPAN><SPAN id=Codehighlighter1_3518_3854_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;取消扮演</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;impersonatedUser.Undo();</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(tokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr.Zero)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CloseHandle(tokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;(dupeTokenHandle&nbsp;</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">&nbsp;IntPtr.Zero)<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CloseHandle(dupeTokenHandle);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV><BR>最近太忙,好久不来,贴段刚写的代码,希望大家还记得我.<img src ="http://www.cnblogs.com/dahuaidan410/aggbug/57471.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42958/" target="_blank">[新闻]资本寒冬侵袭中国视频网站 营销春天或不远</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>Friend Assemblies(.NET FrameWork 2.0新特性)</title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41777.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Fri, 10 Sep 2004 05:08:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41777.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/41777.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41777.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/41777.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/41777.html</trackback:ping><description><![CDATA[<BR>一个Assembly中所有的非公共类型，可以被它的【好友】Assembly访问。即如果AssemblyA中声明AssemblyB是它的好友Assembly，则AssemblyB可以像访问自身Assembly一样访问AssemblyA的私有类型。<BR>将另一个Assembly声明成自己的Friend Assembly,需要使用一个InternalsVisibleToAttribute的特性。<BR><BR>[assembly:InternalsVisibleTo ("AssemblyB", PublicKeyToken="32ab4ba45e0a69a1")]<BR><BR>不过，声明Friend Assembly,代表允许AssemblyB访问自己的私有类型，但B不做逆向声明，A是不能访问B的私有类型的。跟现实生活一样。有的人你把他当朋友，什么秘密都告诉他，可人家没把你当朋友(开个玩笑，我身边没有)。<IMG src="http://www.cnblogs.com/Emoticons/tongue_smile.gif"><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/41777.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42957/" target="_blank">[新闻]金融风暴波及全球创业板 中国概念股难独善其身</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>.NET Remoting的新特性-IpcChannel(.NET Framework 2.0) </title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41726.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Fri, 10 Sep 2004 03:00:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41726.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/41726.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/09/10/41726.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/41726.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/41726.html</trackback:ping><description><![CDATA[.NET FrameWoek2.0中，新添加一个IpcChannel,它是利用Windows的Ipc(进程间通讯)实现的一个Remoting的Channel，它的速度比Http或Tcp的Channel快很多，但它只能被用在本机不同应用程序域之间的通讯,所以，如果我们的客户端有可能与服务器端在同一个机器上运行时，可以通过注册IcpChannel来提高性能。<BR>下面是一个简单的IpcChannel的示例：<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%; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_0_218_Closed_Image onclick="this.style.display='none'; Codehighlighter1_0_218_Closed_Text.style.display='none'; Codehighlighter1_0_218_Open_Image.style.display='inline'; Codehighlighter1_0_218_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top><IMG id=Codehighlighter1_0_218_Open_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_0_218_Open_Text.style.display='none'; Codehighlighter1_0_218_Closed_Image.style.display='inline'; Codehighlighter1_0_218_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><SPAN id=Codehighlighter1_0_218_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">Using&nbsp;directives</SPAN><SPAN id=Codehighlighter1_0_218_Open_Text style="DISPLAY: none"><SPAN style="COLOR: #0000ff">#region</SPAN><SPAN style="COLOR: #000000">&nbsp;Using&nbsp;directives</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Collections.Generic;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Text;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Runtime.Remoting;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Runtime.Remoting.Channels;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000">&nbsp;System.Runtime.Remoting.Channels.Ipc;<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">#endregion</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000">&nbsp;TestIpcChannel<BR><IMG id=Codehighlighter1_246_952_Open_Image onclick="this.style.display='none'; Codehighlighter1_246_952_Open_Text.style.display='none'; Codehighlighter1_246_952_Closed_Image.style.display='inline'; Codehighlighter1_246_952_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_246_952_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_246_952_Closed_Text.style.display='none'; Codehighlighter1_246_952_Open_Image.style.display='inline'; Codehighlighter1_246_952_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_246_952_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_246_952_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;Program<BR><IMG id=Codehighlighter1_270_784_Open_Image onclick="this.style.display='none'; Codehighlighter1_270_784_Open_Text.style.display='none'; Codehighlighter1_270_784_Closed_Image.style.display='inline'; Codehighlighter1_270_784_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_270_784_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_270_784_Closed_Text.style.display='none'; Codehighlighter1_270_784_Open_Image.style.display='inline'; Codehighlighter1_270_784_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_270_784_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_270_784_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Main(</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">[]&nbsp;args)<BR><IMG id=Codehighlighter1_320_778_Open_Image onclick="this.style.display='none'; Codehighlighter1_320_778_Open_Text.style.display='none'; Codehighlighter1_320_778_Closed_Image.style.display='inline'; Codehighlighter1_320_778_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_320_778_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_320_778_Closed_Text.style.display='none'; Codehighlighter1_320_778_Open_Image.style.display='inline'; Codehighlighter1_320_778_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_320_778_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_320_778_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IpcChannel&nbsp;myChannel&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;IpcChannel(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">test</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ChannelServices.RegisterChannel(myChannel);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemotingConfiguration.RegisterWellKnownServiceType(</SPAN><SPAN style="COLOR: #0000ff">typeof</SPAN><SPAN style="COLOR: #000000">(RemObject),&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">RemObject.rem</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,&nbsp;WellKnownObjectMode.SingleCall);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">服务注册结束，下面是客户端代码</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RemObject&nbsp;obj&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(RemObject)(Activator.GetObject(</SPAN><SPAN style="COLOR: #0000ff">typeof</SPAN><SPAN style="COLOR: #000000">(RemObject),&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Ipc://Test/RemObject.rem</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">));<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;obj.TestMethod();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.ReadLine();<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;RemObject&nbsp;:&nbsp;MarshalByRefObject<BR><IMG id=Codehighlighter1_838_949_Open_Image onclick="this.style.display='none'; Codehighlighter1_838_949_Open_Text.style.display='none'; Codehighlighter1_838_949_Closed_Image.style.display='inline'; Codehighlighter1_838_949_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_838_949_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_838_949_Closed_Text.style.display='none'; Codehighlighter1_838_949_Open_Image.style.display='inline'; Codehighlighter1_838_949_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_838_949_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_838_949_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;TestMethod()<BR><IMG id=Codehighlighter1_881_943_Open_Image onclick="this.style.display='none'; Codehighlighter1_881_943_Open_Text.style.display='none'; Codehighlighter1_881_943_Closed_Image.style.display='inline'; Codehighlighter1_881_943_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_881_943_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_881_943_Closed_Text.style.display='none'; Codehighlighter1_881_943_Open_Image.style.display='inline'; Codehighlighter1_881_943_Open_Text.style.display='inline';" src="http://www.cnblogs.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_881_943_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.cnblogs.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_881_943_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console.WriteLine(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">Hello&nbsp;IcpChannel!</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.cnblogs.com/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>为了便于大家读代码，该程序同时扮演服务器和客户端的角色，可以直接编译执行。<BR><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/41726.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42957/" target="_blank">[新闻]金融风暴波及全球创业板 中国概念股难独善其身</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>我的GMAIL开始使用</title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/08/26/36708.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Thu, 26 Aug 2004 04:20:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/08/26/36708.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/36708.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/08/26/36708.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/36708.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/36708.html</trackback:ping><description><![CDATA[<IMG src="http://www.cnblogs.com/Emoticons/tongue_smile.gif">欢迎大家轰炸<STRONG>chenchangjian@gmail.com</STRONG><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/36708.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42956/" target="_blank">[新闻]携程范敏：CEO从接发传真做起</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>关于委派的返回值</title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31693.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Mon, 09 Aug 2004 14:44:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31693.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/31693.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31693.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/31693.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/31693.html</trackback:ping><description><![CDATA[<FONT color=#000033></FONT>
<DIV class=O v:shape="_x0000_s1026">
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN><FONT color=#000000 size=2>委派返回值为其函数列表中最后一个调用的返回值，不过一般我们不会去关心它。<IMG src="http://www.cnblogs.com/Emoticons/tongue_smile.gif"><BR></FONT></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>简单示例如下：<BR>#region Using directives </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; FONT-FAMILY: 宋体; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033></FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>using System; </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>using System.Collections.Generic; </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>using System.Text; </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; FONT-FAMILY: 宋体; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033></FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>#endregion </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; FONT-FAMILY: 宋体; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033></FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>namespace ConsoleApplication3 </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>{ </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>class Program </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>{ </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>delegate string DelegateTest(string input); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>static void Main(string[] args) </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>DelegateTest din = new DelegateTest(Test1); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>din += new DelegateTest(Test2); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string rlt = din("123"); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.WriteLine(rlt); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.ReadLine(); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>static string Test1(string inp) </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.WriteLine("Test1"); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "test1"; </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>static string Test2(string inp) </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{ </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>Console.WriteLine("Test2"); </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>return "test2"; </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>} </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>} </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN style="FONT-SIZE: 44%; COLOR: yellow"><SPAN style="LEFT: -6.07%; POSITION: absolute; mso-special-format: bullet"><FONT color=#000033>&#8226;</FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 8pt; COLOR: yellow; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN; mso-ansi-language: 1024"><FONT color=#000033>} </FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 20 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><SPAN lang=EN-US style="FONT-SIZE: 8pt; COLOR: yellow; FONT-FAMILY: 宋体; mso-fareast-font-family: 宋体; mso-hansi-font-family: Arial; mso-fareast-language: ZH-CN"><FONT color=#000033></FONT></SPAN></DIV>
<DIV style="mso-line-spacing: '80 50 0'; mso-margin-left-alt: 216; mso-char-wrap: 1; mso-kinsoku-overflow: 1"><FONT color=#000033></FONT></DIV></DIV><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/31693.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42955/" target="_blank">[新闻]2008年10月13日科技博客精选</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>.NET Remoting中的事件处理(.NET Framework 2.0) </title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31658.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Mon, 09 Aug 2004 13:10:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31658.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/31658.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/08/09/31658.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/31658.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/31658.html</trackback:ping><description><![CDATA[全文请参见：<A href="http://www.cnblogs.com/dahuaidan410/articles/31656.aspx">http://www.cnblogs.com/dahuaidan410/articles/31656.aspx</A><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/31658.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42955/" target="_blank">[新闻]2008年10月13日科技博客精选</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item><item><title>关于MyIE2中博客园页面自动跳转的问题回答</title><link>http://www.cnblogs.com/dahuaidan410/archive/2004/07/20/25750.html</link><dc:creator>大坏蛋</dc:creator><author>大坏蛋</author><pubDate>Tue, 20 Jul 2004 00:37:00 GMT</pubDate><guid>http://www.cnblogs.com/dahuaidan410/archive/2004/07/20/25750.html</guid><wfw:comment>http://www.cnblogs.com/dahuaidan410/comments/25750.html</wfw:comment><comments>http://www.cnblogs.com/dahuaidan410/archive/2004/07/20/25750.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.cnblogs.com/dahuaidan410/comments/commentRss/25750.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/dahuaidan410/services/trackbacks/25750.html</trackback:ping><description><![CDATA[在浏览cnblogs中的某些页面时（常常是主页），加载完页面后就自动跳转到下面页面了。<BR>地址栏中的URL变成了：http:///<BR><BR><FONT color=#003300><U>该问题是由MyIE2的插件引起的，在MyIE2选项中，将那些无聊的插件去掉即可<BR><BR></U>不过我想：遇到问题的朋友，能看到该页面吗？<IMG src="http://www.cnblogs.com/Emoticons/hitwall.gif"></FONT><img src ="http://www.cnblogs.com/dahuaidan410/aggbug/25750.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42954/" target="_blank">[新闻]Google Android手机大受欢迎,已经订出150万台</a><br/><a href="http://www.cnblogs.com" target="_blank">博客园首页</a>&nbsp;<a href="http://space.cnblogs.com" target="_blank">社区</a>&nbsp;<a href="http://news.cnblogs.com" target="_blank">新闻频道</a>&nbsp;<a href="http://space.cnblogs.com/group.htm" target="_blank">小组</a>&nbsp;<a href="http://space.cnblogs.com/q" target="_blank">博问</a>&nbsp;<a href="http://wz.cnblogs.com/" target="_blank">网摘</a>&nbsp;<a href="http://space.cnblogs.com/ing" target="_blank">闪存</a>]]></description></item></channel></rss>