<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Anytao.net</title><link>http://weblogs.asp.net/anytao/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>[xRM], Find xRM in PDC09</title><link>http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-find-xrm-in-pdc09.aspx</link><pubDate>Mon, 08 Feb 2010 09:19:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7338681</guid><dc:creator>anytao</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=7338681</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-find-xrm-in-pdc09.aspx#comments</comments><description>If you ask question like “What’s new in xRM”, It’s limited resource currently. In PDC09, there are about 4 different sessions have related with the next version of Microsoft Dynamic CRM 5, codename as “xRM”. Here are some list for these sessions: Managing...(&lt;a href="http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-find-xrm-in-pdc09.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7338681" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/xRM/default.aspx">xRM</category><category domain="http://weblogs.asp.net/anytao/archive/tags/PDC/default.aspx">PDC</category></item><item><title>[xRM], Introuduction show about xRM</title><link>http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-introuduction-show-about-xrm.aspx</link><pubDate>Mon, 08 Feb 2010 09:09:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7338659</guid><dc:creator>anytao</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=7338659</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-introuduction-show-about-xrm.aspx#comments</comments><description>A great introduction about xRM show is published in youtube, have a look. &amp;#160; &amp;#160; Tao | 你必须知道的.NET www.anytao.com |*: anytao@live.com | Twitter: http://twitter.com/anytao | Blog: http://anytao.cnblogs.com/...(&lt;a href="http://weblogs.asp.net/anytao/archive/2010/02/08/xrm-introuduction-show-about-xrm.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7338659" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/xRM/default.aspx">xRM</category></item><item><title>Localization solution in Silverlight</title><link>http://weblogs.asp.net/anytao/archive/2009/02/05/localization-solution-in-silverlight.aspx</link><pubDate>Thu, 05 Feb 2009 10:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6884537</guid><dc:creator>anytao</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6884537</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2009/02/05/localization-solution-in-silverlight.aspx#comments</comments><description>Localization is a typcal keynote in Silverlight App. Unfortunately, silverlight 2 didn’t have enough support to localization. We can not get a solution complete same as ASP.NET Apps. So here give us a hot example show how to implement localization in Silverlight. Of course, I still expect improvement in next release....(&lt;a href="http://weblogs.asp.net/anytao/archive/2009/02/05/localization-solution-in-silverlight.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6884537" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/SilverLight/default.aspx">SilverLight</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Globalization/default.aspx">Globalization</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Localization/default.aspx">Localization</category></item><item><title>Hot Find #1, Dec 2008</title><link>http://weblogs.asp.net/anytao/archive/2008/12/30/hot-find-1-dec-2008.aspx</link><pubDate>Tue, 30 Dec 2008 02:48:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6808883</guid><dc:creator>anytao</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6808883</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2008/12/30/hot-find-1-dec-2008.aspx#comments</comments><description>Published 30 Dec 2008, by Anytao © 2008 Anytao.com , A fun world for making tech as art. Hot Find will be the most popular articals or funny technical find about .NET world, it shares ideas and knowledges from web and give us more guide support. Tommorrow...(&lt;a href="http://weblogs.asp.net/anytao/archive/2008/12/30/hot-find-1-dec-2008.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6808883" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/Hot+Find/default.aspx">Hot Find</category></item><item><title>Tips: Better GetXXByYY in LINQ</title><link>http://weblogs.asp.net/anytao/archive/2008/10/22/tips-better-getxxbyyy-in-linq.aspx</link><pubDate>Tue, 21 Oct 2008 16:26:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6696658</guid><dc:creator>anytao</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6696658</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2008/10/22/tips-better-getxxbyyy-in-linq.aspx#comments</comments><description>In a post Creating the Table Adapter Methods for GetUserByLogin, GetUserByUserName, and InsertUser, Nannette Thacker gives a good way to implement a table adapter for solving GetXXByYY in coding repeat works. Indeed, it’s very populating to implement the GetUserByName, GetUserByID, GetUserByEmail or ValidateUser and so on. So usually, you need to implement different services for UI calling, but there service basically has same implement process...(&lt;a href="http://weblogs.asp.net/anytao/archive/2008/10/22/tips-better-getxxbyyy-in-linq.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6696658" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/Lambda+Expression/default.aspx">Lambda Expression</category><category domain="http://weblogs.asp.net/anytao/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/anytao/archive/tags/C_2300_/default.aspx">C#</category></item><item><title>Tips: Using Reflection to assign value intelligently</title><link>http://weblogs.asp.net/anytao/archive/2008/09/26/tips-using-reflection-to-assign-value-intelligently.aspx</link><pubDate>Fri, 26 Sep 2008 06:24:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6642400</guid><dc:creator>anytao</dc:creator><slash:comments>33</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6642400</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2008/09/26/tips-using-reflection-to-assign-value-intelligently.aspx#comments</comments><description>Usually, we map data from DB into models in for DAL. Of cource, we aslo encapsulate the models into Business Object(BO) or Domain Object(DO) for BLL. That's usual design affairs. In the case of design, different layers make a clear organize about business logic from data, service and so on.

However, it's unavoidable to pass value from Models to BOs to run business logic or pass value from BOs to Models to save data. This is unreasonable to handle many data transfer but necessary in this satuiation. How can we make it easy? Of course it is. Refelecting is a useful way to make data transfer easy for different CLR types value assignment....(&lt;a href="http://weblogs.asp.net/anytao/archive/2008/09/26/tips-using-reflection-to-assign-value-intelligently.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6642400" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/CLR/default.aspx">CLR</category><category domain="http://weblogs.asp.net/anytao/archive/tags/CodeHelper/default.aspx">CodeHelper</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Reflection/default.aspx">Reflection</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Generic/default.aspx">Generic</category></item><item><title>Microsoft Spirit</title><link>http://weblogs.asp.net/anytao/archive/2008/08/22/microsoft-spirit.aspx</link><pubDate>Fri, 22 Aug 2008 02:59:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6549795</guid><dc:creator>anytao</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6549795</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2008/08/22/microsoft-spirit.aspx#comments</comments><description>Published 22 Aug 2008, by Anytao © 2008 Anytao.com , A fun world for making tech as art. I'm anytao, Visual C# MVP of Microsoft, and come from China. Contents If a country has its sprit, this nation and its people will overcome any difficult time, such...(&lt;a href="http://weblogs.asp.net/anytao/archive/2008/08/22/microsoft-spirit.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6549795" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/anytao/default.aspx">anytao</category><category domain="http://weblogs.asp.net/anytao/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://weblogs.asp.net/anytao/archive/tags/Inside.NET/default.aspx">Inside.NET</category></item><item><title>Ways of Performance in .NET - Part1</title><link>http://weblogs.asp.net/anytao/archive/2008/05/30/anytao_5F00_performance_5F00_01.aspx</link><pubDate>Thu, 29 May 2008 17:08:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6229763</guid><dc:creator>anytao</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/anytao/rsscomments.aspx?PostID=6229763</wfw:commentRss><comments>http://weblogs.asp.net/anytao/archive/2008/05/30/anytao_5F00_performance_5F00_01.aspx#comments</comments><description>&lt;P&gt;&lt;A href="http://book.anytao.com/"&gt;&lt;FONT color=#ff0000&gt;book.anytao.com&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp;| &lt;FONT color=#0000ff&gt;&lt;A href="http://www.anytao.com/"&gt;&lt;FONT color=#ff0000&gt;Anytao in chinese&lt;/FONT&gt;&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;H2 align=center&gt;&lt;FONT face=微软雅黑 color=#0000ff size=6&gt;[&lt;A href="http://www.anytao.com/" target=_blank&gt;&lt;FONT color=#669966&gt;Anytao&lt;/FONT&gt;&lt;/A&gt;]Ways of Performance in .NET - Part1&lt;/FONT&gt;&lt;/H2&gt;
&lt;P align=right&gt;Published 30 May 2008, by&lt;FONT face=微软雅黑&gt; &lt;/FONT&gt;&lt;FONT face=微软雅黑 color=#669966&gt;&lt;A href="https://mvp.support.microsoft.com/profile/Tao"&gt;Anytao&lt;/A&gt;&lt;/FONT&gt; &lt;BR&gt;&lt;FONT face=微软雅黑 color=#ff0000&gt;© 2008 &lt;/FONT&gt;&lt;A href="http://www.anytao.com/"&gt;&lt;FONT face=微软雅黑 color=#ff0000&gt;Anytao.com&lt;/FONT&gt;&lt;/A&gt;,&amp;nbsp;A fun world for&amp;nbsp;making tech as art.&lt;FONT face=微软雅黑 color=#ff0000&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;TABLE class="" style="BORDER-COLLAPSE: collapse" border=0 unselectable="on"&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 590px"&gt;&lt;/COLGROUP&gt;
&lt;TBODY vAlign=top&gt;
&lt;TR style="BACKGROUND: #87bfd1"&gt;
&lt;TD class="" style="BORDER-RIGHT: #9bbb59 1pt solid; PADDING-RIGHT: 7px; BORDER-TOP: #9bbb59 1pt solid; PADDING-LEFT: 7px; BORDER-LEFT: #9bbb59 1pt solid; BORDER-BOTTOM: #9bbb59 1pt solid"&gt;&lt;SPAN style="COLOR: white"&gt;&lt;IMG src="http://www.cnblogs.com/images/cnblogs_com/anytao/125111/o_icon_your_info.gif" art="Anytao.com"&gt;I'm anytao, Visual C# MVP of Microsoft, and come from China.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #9bbb59 1pt solid; PADDING-RIGHT: 7px; BORDER-TOP: medium none; PADDING-LEFT: 7px; BORDER-LEFT: #9bbb59 1pt solid; BORDER-BOTTOM: #9bbb59 1pt solid"&gt;
&lt;P&gt;&lt;STRONG&gt;Contents&lt;/STRONG&gt; 
&lt;P&gt;21 different ways about performance in .NET 
&lt;P&gt;How to implement the rules to improve the performance&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color=#408080 size=4&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;P&gt;What is a good software product? Operation Process, User Experience, Security and Performance are all the necessary factors. A good performance system is one of the important score in the users’ survey. In the stock exchange center, there is tens of thousands of data exchange running in the stocker’s hand. Steadying running and effective performance is a must. At the same time, performance is also concerned in small software system, slow product always lose your face for customers. 
&lt;P&gt;Therefore, performance is important in system design. The influence in performance goes in different way, such as hardware, database, and software design. In this article, I’ll take attention to performance killer in .NET, list all general performance problem as items, including rules, habits, and syntax etc. According to all the performance item, you’ll get basic knowledge about how to improve your software from CLR and .NET Framework. 
&lt;P&gt;However, all the improvement items are on the basis of .NET foundation, not application area, such as Website Performance and Tuning, database improvement. OK, start our performance travel in our .NET world. 
&lt;H5&gt;&lt;FONT color=#408080 size=4&gt;&lt;STRONG&gt;Performance Rules&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H5&gt;
&lt;P&gt;&lt;FONT color=#008040&gt;&lt;STRONG&gt;Item1: Use Dispose taking the place of Finalize in unmanaged resources collection process.&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;About the collection process of unmanaged resources are so different from manage resources in CLR. Basically, there are two way to collect them: Dispose &amp;amp; Finalize. Finalize have no exact implement time when running collection and also have performance loss in finalizing queue mechanism. In another hand, Dispose model gives programmer more control rights. We can control the exact run time and have no loss in other factors. 
&lt;P&gt;So, dispose model is recommended. 
&lt;P&gt;&lt;FONT color=#008040&gt;&lt;STRONG&gt;Item2: Select proper garbage collector: Workstation GC and Server GC.&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;.NET CLR implement two garbage collectors, different collector have different algorithm, design for different CPU: Workstation GC is used to handle the single CPU System as default in CLR, Server GC is used to handle the muti-CPU Server System. Thence, you can’t server a Workstation GC in muti-CPU in result of performance loss and unfit a high throughout capacity in parallel model. 
&lt;P&gt;Select proper GC is a key element in performance. 
&lt;P&gt;&lt;FONT color=#008040&gt;&lt;STRONG&gt;Item3: Use WeakReference for large object.&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;WeakReference is one of effective way to improve large object performance. Generally speaking, WeakReference is an intermediate state for an object. It means a WeakReference object can be collect by GC when it become garbage, and also can be invoke by application when necessary. That’s impossible for common object. Usually, large object need more memory to create. WeakReference will give a chance to GC when lack of memory, and also use this object as normal before its collection. It makes a possible for time and space. 
&lt;P&gt;In .NET, &lt;I&gt;WeakReference&lt;/I&gt; class is used for this process. &lt;I&gt;Target&lt;/I&gt; attribute refers to the large object and generate a strong reference to a variable. Here is the usage about WeakReference. 
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; WeakRef()&lt;/PRE&gt;&lt;PRE&gt;{&lt;/PRE&gt;&lt;PRE class=alt&gt;    MyClass mc = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; MyClass();&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE class=alt&gt;    &lt;SPAN class=rem&gt;//Create WeakReference&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;    WeakReference wr = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; WeakReference(mc);&lt;/PRE&gt;&lt;PRE class=alt&gt;    &lt;SPAN class=rem&gt;//Remove the strong reference&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;    mc = &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE class=alt&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (wr.IsAlive)&lt;/PRE&gt;&lt;PRE class=alt&gt;    {&lt;/PRE&gt;&lt;PRE&gt;        &lt;SPAN class=rem&gt;//Weak Reference change into a strong reference&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;        &lt;SPAN class=rem&gt;//object can be used again&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;        mc = wr.Target &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; MyClass;&lt;/PRE&gt;&lt;PRE class=alt&gt;    }&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=kwrd&gt;else&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;    {&lt;/PRE&gt;&lt;PRE&gt;        &lt;SPAN class=rem&gt;//Create a new object to mc&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;        mc = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; MyClass();&lt;/PRE&gt;&lt;PRE&gt;    }&lt;/PRE&gt;&lt;PRE class=alt&gt;}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;

&lt;P&gt;&lt;FONT color=#008040&gt;&lt;STRONG&gt;Item4: Implement resource collection in using block.&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;The best practice of Dispose Model for resource collection is using block. It’s simplicity and elegance in syntax. And make sure to implement the dispose() method finally. The following is a non-using block expression for resource collectin: 
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;static&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; Main()&lt;/PRE&gt;&lt;PRE&gt;{&lt;/PRE&gt;&lt;PRE class=alt&gt;    FileDealer fd = &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;    &lt;SPAN class=kwrd&gt;try&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;    {&lt;/PRE&gt;&lt;PRE&gt;        fd = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; FileDealer(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; IntPtr(), &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; ManagedRes());&lt;/PRE&gt;&lt;PRE class=alt&gt;        fd.Read();&lt;/PRE&gt;&lt;PRE&gt;    }&lt;/PRE&gt;&lt;PRE class=alt&gt;    &lt;SPAN class=kwrd&gt;finally&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;    {&lt;/PRE&gt;&lt;PRE class=alt&gt;        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt;(fd != &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE&gt;            fd.Dispose();&lt;/PRE&gt;&lt;PRE class=alt&gt;    }&lt;/PRE&gt;&lt;PRE&gt;}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;

&lt;P&gt;Using block give a more effective way to carry out this request as follows: 
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;static&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; Main()&lt;/PRE&gt;&lt;PRE&gt;{&lt;/PRE&gt;&lt;PRE class=alt&gt;    &lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt;(FileDealer fd = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; FileDealer(&lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; IntPtr(), &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; ManagedRes()))&lt;/PRE&gt;&lt;PRE&gt;    {&lt;/PRE&gt;&lt;PRE class=alt&gt;        fd.Read();&lt;/PRE&gt;&lt;PRE&gt;    }&lt;/PRE&gt;&lt;PRE class=alt&gt;}&lt;/PRE&gt;&lt;/DIV&gt;
&lt;STYLE type=text/css&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/STYLE&gt;

&lt;P&gt;Of course, using is best. 
&lt;P&gt;Another rules will come soon...:-) 
&lt;P&gt;&lt;A class="" name=_MailAutoSig&gt;&lt;/A&gt;&lt;B&gt;&lt;FONT color=#669966&gt;Tao&lt;/FONT&gt;&lt;/B&gt; | &lt;A href="http://book.anytao.com/"&gt;&lt;FONT color=#669966&gt;Inside Necessary .NET&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.anytao.com/"&gt;&lt;FONT color=#669966&gt;www.anytao.com&lt;/FONT&gt;&lt;/A&gt;&amp;nbsp; | Blog: &lt;A href="http://anytao.cnblogs.com/"&gt;&lt;FONT color=#669966&gt;http://anytao.cnblogs.com/&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Tao Wang&lt;/STRONG&gt; is Senior Developer working on&amp;nbsp;a chinese company and responsible for project framework design, software develop and management. Tao is proficient with CLR Essential, good command of ASP.NET、ADO.NET、XML、SQL Server, and skilled in object-oriented, design pattern. Here is&amp;nbsp;my new book about .NET inside 
&lt;DIV&gt;
&lt;TABLE class="" style="BORDER-COLLAPSE: collapse" border=0 unselectable="on"&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 590px"&gt;&lt;/COLGROUP&gt;
&lt;TBODY vAlign=top&gt;
&lt;TR style="BACKGROUND: #87bfd1"&gt;
&lt;TD class="" style="BORDER-RIGHT: #9bbb59 1pt solid; PADDING-RIGHT: 7px; BORDER-TOP: #9bbb59 1pt solid; PADDING-LEFT: 7px; BORDER-LEFT: #9bbb59 1pt solid; BORDER-BOTTOM: #9bbb59 1pt solid"&gt;&lt;SPAN style="COLOR: white"&gt;&lt;IMG src="http://www.cnblogs.com/images/cnblogs_com/anytao/125111/o_icon_your_info.gif" art="Anytao.com"&gt;&lt;FONT color=#0000ff&gt;My new book &lt;FONT size=4&gt;&lt;STRONG&gt;Inside Necessary .NET&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" style="BORDER-RIGHT: #9bbb59 1pt solid; PADDING-RIGHT: 7px; BORDER-TOP: medium none; PADDING-LEFT: 7px; BORDER-LEFT: #9bbb59 1pt solid; BORDER-BOTTOM: #9bbb59 1pt solid"&gt;
&lt;P&gt;&lt;A href="http://book.anytao.com/" target=_blank&gt;&lt;IMG src="http://www.cnblogs.com/images/cnblogs_com/anytao/129510/o_anytao_cnblogs_bannertop.gif"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;See &lt;A href="http://book.anytao.com/" target=_blank&gt;&lt;FONT color=#669966&gt;book.anytao.com&lt;/FONT&gt;&lt;/A&gt; in detail.&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;P align=right&gt;&lt;FONT face=微软雅黑&gt;© 2008 &lt;/FONT&gt;&lt;A href="http://www.anytao.com/"&gt;&lt;FONT face=微软雅黑 color=#669966&gt;Anytao.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=微软雅黑&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=right&gt;&lt;FONT face=微软雅黑&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6229763" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/anytao/archive/tags/Performance/default.aspx">Performance</category><category domain="http://weblogs.asp.net/anytao/archive/tags/CLR/default.aspx">CLR</category><category domain="http://weblogs.asp.net/anytao/archive/tags/anytao/default.aspx">anytao</category><category domain="http://weblogs.asp.net/anytao/archive/tags/.NET/default.aspx">.NET</category></item></channel></rss>