<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"> <channel><title><![CDATA[DongPad]]></title><link><![CDATA[http://www.dongpad.com]]></link> <link rel="Shortcut Icon" href="favicon.ico" /> <description>Every day is a new beginning!</description><copyright>2.0 beta 03</copyright> <language>zh-cn</language><item><title><![CDATA[depends.exe &amp; dumpbin.exe]]></title><description><![CDATA[This Article is Published by Live Writer。<p>1.vc自带的工具<strong><font color="#ff0000">depends.exe</font></strong>可以查看exe或dll依赖哪些dll的工具。通常情况下，自己编写的程序要依赖系统或其他软件的各种dll文件，如果在另一台电脑上没有这些文件程序运行就会报错。VS的depends.exe工具能够帮我们找到依赖文件的名称路径等。一般depends.exe位置在“D:\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\depends.exe ”</p>  <p>2.<strong><font color="#ff0000">dumpbin.exe</font></strong>是visual studio中带的工具，可以查看二进制文件的信息，其中就可以用来查看一个程序依赖的dll： </p>  <p>dumpbin.exe /dependents <executable file path> </p>  <p>其位置一般在“C:\Program Files\Microsoft Visual Studio 8\VC\bin\dumpbin.exe”。</p>  <p>3.另外推荐一个<font color="#ff0000"><strong>Process Explorer</strong></font> ，它可以显示有关进程已打开或加载哪些句柄和 DLL 的信息。<a href="http://technet.microsoft.com/zh-cn/sysinternals/bb896653" target="_blank">链接在这里</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20110524-261.html]]></link><pubdate><![CDATA[2011-5-24 11:39:23]]></pubdate></item><item><title><![CDATA[如何验证信用卡是否合法]]></title><description><![CDATA[<img alt="" src="/UserFiles/Image/HowToValidateCreditCard.jpg" border="0" >
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/LStudy-20110227-260.html]]></link><pubdate><![CDATA[2011-2-27 15:34:03]]></pubdate></item><item><title><![CDATA[How to make XmlnsDefinition work on the local assembly?]]></title><description><![CDATA[This Article is Published by Live Writer。<p>track @ <a href="http://stackoverflow.com/questions/2760504/how-to-make-xmlnsdefinition-work-on-the-local-assembly">http://stackoverflow.com/questions/2760504/how-to-make-xmlnsdefinition-work-on-the-local-assembly</a></p>  <h2><strong>Q:</strong></h2>  <p>I've started using the XmlnsDefinition attribute to tie together some CLR namespaces into a single xmlns for convenience in XAML.</p>  <p>Unfortunately, it seems that this only works when using foreign assemblies. If I have a XAML file in the same assembly as the types that are in the namespace I'm referencing from XmlnsDefinition, then the compiler gives an error about the type not existing in the xmlns I am defining.</p>  <p>Moving the type to a foreign assembly fixes the problem.</p>  <p>Is there a way to use XmlnsDefinition on an assembly and have it be used from within that assembly via XAML?</p>  <h2><strong>A:</strong></h2>  <p>Unfortunately, no. The XAML file must be parsed before the assembly is built in order to generate the code implied by the XAML to be included in the assembly. The XAML compiler produces code behind files (the files ending in, for example, .g.cs) and these file then become part of the assembly the XAML file is contained in. Since the assembly hasn't been built yet, the XAML compiler cannot load it to determine XmlnsDeclaration attributes have been specified.</p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20110214-259.html]]></link><pubdate><![CDATA[2011-2-14 9:08:52]]></pubdate></item><item><title><![CDATA[LINQ to SQL Debug Visualizer]]></title><description><![CDATA[<a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx">http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx</a></p>  <p><img src="http://www.scottgu.com/blogposts/linqtosql3/step5.jpg" /> </p>  <p>how to install:</p>  <p>1.download a copy of it <a href="http://www.scottgu.com/blogposts/linqquery/SqlServerQueryVisualizer.zip">here</a></p>  <p>2.copy the assembly into your local<font color="#ff0000"> \Program Files\Microsoft Visual Studio 9.0\Common7\Packages\Debugger\Visualizers</font> directory.</p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20110211-258.html]]></link><pubdate><![CDATA[2011-2-11 10:06:20]]></pubdate></item><item><title><![CDATA[F#对斐波那契数列求和]]></title><description><![CDATA[This Article is Published by Live Writer。<p>如题,1+1+2+3+5+8+13+…?</p>  <p>let sumfib n =    <br />&#160;&#160;&#160; let rec fib x =     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; match x with     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; | 1 -> 1     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; | 2 -> 1     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; | x -> fib(x-2)+fib(x-1)&#160;&#160;&#160; <br />&#160;&#160;&#160; let rec addfib x =     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; match x with     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; | 1 -> 1     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; | x -> fib (x)+ addfib (x-1)&#160;&#160;&#160; <br />&#160;&#160;&#160; addfib n</p>  <p><strong><font color="#808040">cool!</font></strong></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/FSharp-20100811-257.html]]></link><pubdate><![CDATA[2010-8-11 14:01:39]]></pubdate></item><item><title><![CDATA[Isolated Storage in SL4]]></title><description><![CDATA[This Article is Published by Live Writer。<p>在Silverlight4中，默认应用程序存储配额是1MB=1024KB=1048576Bytes，可以在SL程序的右键菜单点击查看，如下图1：</p>  <p><img src="http://www.dongpad.com/userfiles/image/Silverlight4IsolatedStorage.PNG" /> </p>  <p>如果要申请配额，可以在构造里检查存储配额然后执行一下代码，但要考虑到用户可能阻止该请求：</p>  <p>using (var store = IsolatedStorageFile.GetUserStoreForApplication())    <br />{     <br />&#160;&#160;&#160; Int64 IsoQuota = store.Quota; //<font color="#ff0000"><strong>单位为bytes</strong></font>     <br />&#160;&#160;&#160; Int64 requestIsoQuota = 1000;     <br />&#160;&#160;&#160; if (store.IncreaseQuotaTo(IsoQuota +requestIsoQuota )) //<font color="#ff0000">增加到指定大小</font>     <br />&#160;&#160;&#160; {     <br />&#160;&#160;&#160;&#160;&#160;&#160; //……     <br />&#160;&#160;&#160; }     <br />}</p>  <p>执行上述代码将自动提示用户"是否要增加可用存储"，结果如下图2：</p>  <p><img src="http://www.dongpad.com/userfiles/image/Silverlight4IsolatedStorageRequest.PNG" /> </p>  <p>为了保持默认的1MB默认存储，我们选择“否”以便于后面的测试，如果选择了“是”也没关系，我们可以在应用程序存储选项页中选择该程序删除网站对应的存储使其重新初始化到1MB。在上述代码中，我们请求增加的配额为1000bytes，但是提示请求的大小依然是默认的配额1MB，这里Silverlight是如何显示申请存储配额时请求的大小的呢？</p>  <p>经测试发现，Silverlight对请求的大小采用了<font color="#ff0000">小数点保留一位四舍五入</font>的策略，上图的请求的大小实际上就是上述代码中(IsoQuota +requestIsoQuota)除以(1MB*1024*1024)四舍五入保留一位小数的结果。在默认配额情况下，如果请求的配额requestIsoQuota 小于0.05MB=52428.8bytes=52429时，提示请求到的存储大小的小数位将被忽略，但这并不影响实际的存储配额，提示请求的大小依然是1.0MB，如果requestIsoQuota大于或等于0.05MB=52428.8bytes（requestIsoQuota类型为Int64，即requestIsoQuota最小为52429时提示请求大小为1.1MB）将提示请求大小为1.1MB。这里我们可以来验证一下，将requestIsoQuota的值更改为52428，提示请求的大小为1.0M，选择“是”对其进行增加可用存储，然后将requestIsoQuota的值更改为1，这时候的提示是请求的大小为1.1M，这也就从侧面反映了显示出来的请求的大小并不影响实际的存储配额，虽然他们可能是不一致的。</p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100719-256.html]]></link><pubdate><![CDATA[2010-7-19 12:13:46]]></pubdate></item><item><title><![CDATA[Difference between DataContext and ItemsSource in ]]></title><description><![CDATA[<p><font color="#ff0000">DataContext is a general (dependency) property of all descendants of FrameworkElement. Is is inherited through the logical tree from parent to children and can be used as an implicit source for DataBinding. It does not do anything by itself, you must basically databind to it.</font></p>]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100626-255.html]]></link><pubdate><![CDATA[2010-6-26 15:04:17]]></pubdate></item><item><title><![CDATA[F# Type Tips]]></title><description><![CDATA[<p>F#有强大的类型推理（type inference），所以在F#中不需要我们显示指定参数类型。如 <font color="#ff0000"><strong>let add p1 p2 = p1+p2;;</strong></font> 这样我们就定义了接收两个int类型参数返回int类型的一个add函数：<font color="#ff0000"><strong>val add : int -> int –> int</strong></font>，这个推理过程是由f#编译器完成的。</p>  <p>因为F#不使用隐式类型转换,所以如果我们对add传入float类型参数，如：add 100.0 200.0，编译将产生如下错误：</p>  <p><strong><font color="#de96a0">stdin(46,5): error FS0001: This expression has type float but is here used with type int</font></strong></p>  <p>因此这里需要显示指定参数的类型，方式如：<font color="#ff0000"><strong>let add2 (p1:float)&#160; p2 = p1+p2;;</strong></font> 这样编译器推理出add2函数接受两个float类型参数并返回float类型：<font color="#ff0000"><strong>val add2 : float -> float -> float</strong></font>。虽然在这里没有显示指定add2的p2参数类型，但是因为显示指定了F#的第一个参数为float类型,p2自然也就被推理为float类型了。因此如果有不同类型的参数，应该为这些参数都显示指定类型，add3接受一个float和一个int类型参数，并返回两个参数的连接形式string：<strong><font color="#ff0000">let add3 (p1:float) (p2:int)=(string p1)+(string p2)</font></strong>，编译器编译结果为：<font color="#ff0000"><strong>val add3 : float -> int -> string</strong></font>，在这里要注意的就是(string p1)，它的意思是对p1进行强制转换。</p>  <p>积硅步以至千里。</p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/FSharp-20100624-254.html]]></link><pubdate><![CDATA[2010-6-24 12:51:43]]></pubdate></item><item><title><![CDATA[我正在看的书籍]]></title><description><![CDATA[<p><strong>1.Foundations of F#<inside man> </strong>    <table cellspacing="0" cellpadding="0" width="752" border="0"><tbody>       <tr>         <td valign="top" width="197"><img height="261" alt="我正在看的电视剧" src="http://www.dongpad.com/UserFiles/Image/foundationsOfFSharp_cover.jpg" width="180" border="0" /></td>          <td valign="top" width="553">Functional programming (FP) is the future of .NET programming, and F# is much more than just an FP language. Every professional .NET programmer needs to learn about FP, and theres no better way to do it than by learning F#and no easier way to learn F# than from <i>Foundations of F#</i>.             <p>If youre already familiar with FP, youll find F# the language youve always dreamed of. And all .NET programmers will find F# an exciting real-world alternative to C# and Visual Basic. This book is likely to have many imitators, but few true competitors. Written by F# evangelist Rob Pickering, and tech reviewed by F#s main designer, Don Syme, this is an elegant, comprehensive introduction to all aspects of the language and an incisive guide to using F# for real-world professional development. F# is the future of programming (not just on .NET), and the future is now.</p>         </td>       </tr>     </tbody></table> </p>  <p>这本书09年夏就开始在看了，后来一度荒废，继而直到上周参加<a href="http://blog.zhaojie.me/2010/06/first-snda-dotnet-conference-all-slides.html" target="_blank">盛大创新院赞助首届.NET技术交流会</a>听了老赵的《F#语言对异步程序设计的支持》，才又激起我对F#探索的兴趣来。也希望籍此机会，好好的熟悉一下F#。</p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/LStudy-20100623-253.html]]></link><pubdate><![CDATA[2010-6-23 13:04:05]]></pubdate></item><item><title><![CDATA[F#之打印函数占位符详解]]></title><description><![CDATA[<p>打印函数主要有三个：<font color="#ff0000"><strong>printf、printfn和sprintf。</strong></font></p>  <p>printf将参数打印到控制台窗口中。printfn将参数打印输出并且换行。</p>  <p>打印函数可以使用下面这些格式指示符：</p>  <p><img src="http://www.dongpad.com/UserFiles/Image/fsharp_printf_indicators.png" />&#160;</p>  <blockquote>   <p>%O格式指示符会将对象进行装箱操作，并调用Object.ToString函数。%A的运作方式相同，但是在调用Object.ToString之前会检查[<StructuredFormatDisplay>]属性指定的任何特殊打印选项。</p>    <p>PS: 紧接着的是来自官方的解释,从侧面说明了 printfn "%O" false (结果为<font color="#ff0000"><strong>False</strong></font>)与 printfn "%A" false(结果为<font color="#ff0000"><strong>false</strong></font>)的区别</p>    <p><font color="#ff0000"><strong>%O 设置通过将对象装箱并使用其 ToString 方法来打印的任何值的格式。</strong></font></p>    <p><font color="#ff0000"><strong>%A 设置使用默认布局设置打印的任何值的格式。</strong></font></p> </blockquote>  <p>sprintf用于输出的目标为一个字符串的情况。</p>  <p>节选自:<a href="http://www.cnitblog.com/cc682/archive/2010/05/24/66297.html" target="_blank">CC682</a>,更多格式请参考<a href="http://msdn.microsoft.com/zh-cn/library/ee370560.aspx" target="_blank">官方Core.Printf的%[flags][width][.precision][type]详解</a></p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/FSharp-20100623-252.html]]></link><pubdate><![CDATA[2010-6-23 13:05:18]]></pubdate></item><item><title><![CDATA[Sequence Diagram RE, LINQ, and Lambdas]]></title><description><![CDATA[<a href="http://blogs.msdn.com/camerons/archive/2010/05/08/sequence-diagram-re-linq-and-lambdas.aspx" target="_blank">from:Skinner's Blog</a></p>  <p><font color="#8000ff" size="1">本文主要介绍了VS2010特性之Sequence Diagram Reverse Engineering对LINQ和Lambdas的扩展</font></p>  <p>The Sequence Diagram Reverse Engineering feature available in Visual Studio 2010 allows you to create a UML 2.1 “like” diagram that represents your source code. I say “like” in the previous sentence because we use all the notation prescribed by the UML standard, but there are a few instances where we add some notation that is not found in the standard. Support for LINQ and Lambda expressions are examples of where we have extended the Combined Fragment notation to include what we have dubbed a “Deferred Call”.</p>  <p>Here’s a simple console application that I’ll use to show what I mean.</p> <font color="#ff8000">略……</font>]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100509-251.html]]></link><pubdate><![CDATA[2010-5-9 23:47:39]]></pubdate></item><item><title><![CDATA[C#编译器(csc.exe)搜索Dll的顺序]]></title><description><![CDATA[This Article is Published by Live Writer。<table border="1" cellspacing="0" cellpadding="0" width="400"><tbody>     <tr>       <td valign="top" width="400">         <p><font color="#ff0000">@CLR via C#2.0 P32</font>            <br />1.工作目录</p>          <p>2.编译器本身目录(PS:根据全局CSC.rsp文件的配置)</p>          <p>3./lib开关指定的目录</p>          <p>4.Lib环境变量指向的工作目录</p>       </td>     </tr>   </tbody></table>  <p>现在，我们来做了一下尝试,在非编译器目录创建如下两个测试类，并对C1编译:</p>  <p>//C1.cs&#160; @cmd prompt: <font color="#ff0000">csc /t:library C1.cs</font></p>  <p>public class C1    <br />{     <br />public string Name{get;set;}     <br />public int Age{get;set;}     <br />}</p>  <p>//Program.cs&#160;&#160; @cmd prompt: <font color="#ff0000">csc /r:C1.dll&#160; Program.cs</font></p>  <p>using System;    <br />public class Program     <br />{     <br />static void Main()     <br />{     <br />C1 c1 = new C1{Name="Jack"};     <br />Console.WriteLine(string.Format("c1's name is {0}",c1.Name));     <br />Console.ReadKey();     <br />}     <br />}</p>  <p>1.编译Program时，由于我们指定的非绝对路径，所以搜索到Program的当前工作目录即结束，我们亦可尝试将C1.Dll剪切到其他工作目录，并指定完整路径进行编译。</p>  <p><strike>2.将C1.dll剪切到csc工作目录C:\Windows\Microsoft.NET\Framework\v3.5(视具体环境而定)，编译不通过，</strike><font color="#ff0000">what r u doing?</font></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100506-250.html]]></link><pubdate><![CDATA[2010-5-6 23:22:44]]></pubdate></item><item><title><![CDATA[面向对象诠释图]]></title><description><![CDATA[This Article is Published by Live Writer。<p><img border="0" alt="" src="http://images.cnblogs.com/cnblogs_com/tyl2008/OOP.jpg" width="512" height="418" /></p>  <p><a href="http://www.cnblogs.com/tyl2008/archive/2010/05/06/1729027.html" target="_blank">from Tyl2008</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100506-249.html]]></link><pubdate><![CDATA[2010-5-6 22:25:54]]></pubdate></item><item><title><![CDATA[about GFW]]></title><description><![CDATA[<img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyNzIxNzg3NDI2NzEmcHQ9MTI3MjE3ODc1OTE1NiZwPTIzNDQ3MSZkPSZnPTQmbz1lZTMyNTUzMjg5NTM*NjllOTg3/MGNlYmI5ZGYzOTc5NCZvZj*w.gif" /><embed width="440" height="420" type="application/x-shockwave-flash" src="http://v5.tinypic.com/player.swf?file=2lml4px&s=5" FlashVars="gig_lt=1272178742671&gig_pt=1272178759156&gig_g=4"></embed><br><font size="1"><a href="http://tinypic.com/player.php?v=2lml4px&s=5">Original Video</a>- More videos at <a href="http://tinypic.com">TinyPic</a></font>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/Life-20100425-248.html]]></link><pubdate><![CDATA[2010-4-25 15:11:29]]></pubdate></item><item><title><![CDATA[无法将 匿名方法 转换为类型“System.Delegate”,因为它不是委托类型]]></title><description><![CDATA[The problem the user is seeing is that the Thread ctor accepts a specific delegate -- the ThreadStart delegate.  The C# compiler will check and make sure your anonymous method matches the signature of the ThreadStart delegate and, if so, produces the proper code under-the-covers to create the ThreadStart delegate for you.<br />
But Control.Invoke is typed as accepting a "Delegate".  This means it can accept any delegate-derived type.  The example above shows an anonymous method that has a void return type and takes no parameters.  It's possible to have a number of delegate-derived types that match that signature (such as MethodInvoker and ThreadStart -- just as an example).  Which specific delegate should the C# compiler use?  There's no way for it to infer the exact delegate type so the compiler complains with an error.<br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20100401-246.html]]></link><pubdate><![CDATA[2010-4-1 18:01:58]]></pubdate></item><item><title><![CDATA[（推荐)VS2010最新AD-想做你的code]]></title><description><![CDATA[<embed src="http://player.youku.com/player.php/sid/XMTYwMjk0ODA0/v.swf" quality="high" width="480" height="400" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/Life-20100326-245.html]]></link><pubdate><![CDATA[2010-3-26 18:24:44]]></pubdate></item><item><title><![CDATA[2010伊始小记]]></title><description><![CDATA[步入2010已经个月有长，小博久不见经传，在此小记一笔，谨以此为2010的奋斗拉开帷幕。来自生活中的各种压力是接踵而至，希望拨开乌云看见天的情怀亦是强烈的很。只言片语，但愿回头看时又是另一番滋味。愿愿愿愿愿。<br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/Life-20100219-244.html]]></link><pubdate><![CDATA[2010-2-19 20:27:50]]></pubdate></item><item><title><![CDATA[IA-32、IA-64英特尔架构（Intel Architecture）]]></title><description><![CDATA[IA64(<strong>Intel Architecture</strong>)架构 <br />
<p>IA64是惠普和Intel携手开发的新一代64位的计算机芯片。<br />IA64处理器I-tanium（安腾）是Intel自推出32位微处理器以来，在高性能计算机领域的又一座里程碑。基于IA64处理器架构的服务器具有64位运算能力、64位寻址空间和64位数据通路，突破了传统IA32架构的许多限制，在数据的处理能力，系统的稳定性、安全性、可用性、可观理性等方面获得了突破性的提高。 </p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/LStudy-20091231-243.html]]></link><pubdate><![CDATA[2009-12-31 12:34:37]]></pubdate></item><item><title><![CDATA[推荐两个免费Visual Studio插件]]></title><description><![CDATA[This Article is Published by Live Writer。<p>文章原出处<a href="http://www.colobu.com">http://www.colobu.com</a>,更多插件参见<a href="http://www.cnblogs.com/smallnest/archive/2009/12/15/1625005.html" target="_blank">这里</a></p>  <h5>5. Copy As HTML</h5>  <p>http://www.lavernockenterprises.co.uk/downloads/copyashtml/copyashtml.aspx</p>  <p>Copy As HTML是一个轻量级的VS插件。你可以利用它在VS中以HTML格式复制你的代码。在复制时它可以保留语法加亮，缩进和背景色，行数等等，方便你复制你的代码到你的博客、文档中。</p>  <p><img src="http://docs.google.com/File?id=dckwjm6x_30d65pn5hm_b" border="0" /></p>  <p></p>  <p></p>  <h5>8. PowerCommands for Visual Studio 2008</h5>  <p>http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=PowerCommands&amp;ReleaseId=559</p>  <p>为VS提供了一堆的命令扩展。</p>  <p><img src="http://docs.google.com/File?id=dckwjm6x_29fwk7h3d6_b" border="0" /></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091222-242.html]]></link><pubdate><![CDATA[2009-12-22 13:46:08]]></pubdate></item><item><title><![CDATA[ZT-数据公钥加密和认证中的私钥公钥]]></title><description><![CDATA[This Article is Published by Live Writer。<h5>基于公开密钥的加密过程</h5>  <ol>   <li>Bob将他的公开密钥传送给Alice。 </li>    <li>Alice用Bob的公开密钥加密她的消息，然后传送给Bob。 </li>    <li>Bob用他的私人密钥解密Alice的消息。</li> </ol>  <p><img src="http://docs.google.com/File?id=dckwjm6x_25cn7zc4c6_b" /></p>  <h5>基于公开密钥的认证过程</h5>  <ol>   <li>Alice用她的私人密钥对文件加密，从而对文件签名。 </li>    <li>Alice将签名的文件传送给Bob。 </li>    <li>Bob用Alice的公钥解密文件，从而验证签名。</li> </ol>  <p><img src="http://docs.google.com/File?id=dckwjm6x_26d2kt7qgs_b" /></p>  <p>原文参见：<a href="http://www.williamlong.info/archives/837.html">数据公钥加密和认证中的私钥公钥</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/LStudy-20091215-241.html]]></link><pubdate><![CDATA[2009-12-15 21:14:50]]></pubdate></item><item><title><![CDATA[A Look Back&hellip;]]></title><description><![CDATA[This Article is Published by Live Writer。<p><img src="http://docs.google.com/File?id=dckwjm6x_24fbq9pfcb_b" /></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091215-240.html]]></link><pubdate><![CDATA[2009-12-15 16:54:19]]></pubdate></item><item><title><![CDATA[Code Contracts from MSDN]]></title><description><![CDATA[<p>Lots of fixes! Our new release, 1.2.21023.14, has been upgraded to work with Visual Studio 2010 Beta 2. (Of course, it also works with Visual Studio 2008, but this is a great time to download the new beta and get started with it.) There are lots of other improvements: be sure to check out the <a href="http://research.microsoft.com/en-us/projects/contracts/releasenotes.aspx">release notes</a>. And keep using the <a href="http://social.msdn.microsoft.com/Forums/en-US/codecontracts/threads/">forum</a> to tell us what you think: many of the fixes were in response to your comments.</p>  <p>Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. We currently provide three tools:</p>  <ul>   <li><strong>Runtime Checking.</strong> Our binary rewriter modifies a program by injecting the contracts, which are checked as part of program execution. Rewritten programs improve testability: each contract acts as an oracle, giving a test run a pass/fail indication. Automatic testing tools, such as Pex, take advantage of contracts to generate more meaningful unit tests by filtering out meaningless test arguments that don't satisfy the pre-conditions. </li>    <li><strong>Static Checking.</strong> Our static checker can decide if there are any contract violations without even running the program! It checks for implicit contracts, such as null dereferences and array bounds, as well as the explicit contracts. (<strong>VSTS Edition only.</strong>) </li>    <li><strong>Documentation Generation.</strong> Our documentation generator augments existing XML doc files with contract information. There are also new style sheets that can be used with <a href="http://www.codeplex.com/Sandcastle">Sandcastle</a> so that the generated documentation pages have contract sections.</li> </ul>  <p>Code Contracts comes in two editions:</p>  <ul>   <li><strong>Code Contracts Standard Edition:</strong> This version installs if you have any edition of Visual Studio other than the Express Edition. It includes the stand-alone contract library, the binary rewriter (for runtime checking), the reference assembly generator, and a set of reference assemblies for the .NET Framework. </li>    <li><strong>Code Contracts VSTS Edition:</strong> This version installs only if you have Visual Studio Team System. It includes the static checker in addition to all of the features in the Code Contracts Standard Edition.</li> </ul>  <p><img title="Download" alt="" src="http://i.msdn.microsoft.com/ee402630.Numeral1_sm(en-us,MSDN.10).png" align="left" />    <br />Download Code Contracts <a href="http://download.microsoft.com/download/B/2/A/B2AC27BD-B797-402D-A02D-1263FBA157FA/Contracts.devlab9std.msi">Standard Edition</a>or <a href="http://download.microsoft.com/download/B/2/A/B2AC27BD-B797-402D-A02D-1263FBA157FA/Contracts.devlab9ts.msi">VSTS Edition.</a></p>  <p><img title="Getting Started Guide" alt="" src="http://i.msdn.microsoft.com/ee402630.Numeral2_sm(en-us,MSDN.10).png" align="left" />    <br />Read the <a href="http://download.microsoft.com/download/C/2/7/C2715F76-F56C-4D37-9231-EF8076B7EC13/userdoc.pdf">Code Contracts documentation</a>.</p><br />
<br />
forgot to leave the oraginal address:http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx<br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091215-239.html]]></link><pubdate><![CDATA[2009-12-15 14:12:35]]></pubdate></item><item><title><![CDATA[&ldquo;Out of the box&rdquo;的解释]]></title><description><![CDATA[This Article is Published by Live Writer。<p>1）“Out of box”用于描述某种不确定的事件。常常作为副词来形容某种观点的不确定性。据说这个词同20世纪早期的英国数学家亨利?恩斯特?杜德耐解答一个著名数学谜语的思路相关。题目要求用四条直线连接平面上三乘三分布的九个点，要求一笔连成，也就是在画线的时候笔不能离开纸面。解决这个数学问题的关键在于要克服传统的在三乘三边界内画点的思想，如果将线连接到边界之外，那么问题可以迎刃而解，这样就产生了“Out of box”这个词。相应的，将思维受限这种情况称为“boxed－in”。在IT领域，节奏变化很快，因此每个人都在寻找“Out of box”的思维方式，尝试创新。    <br />用“In the box”表示某种确定的事情。比如，最近有一篇文章讨论了MP3以及盗版音乐的关系，其中引用了一位业内人士的话表示：“主流唱片公司很少关心互联网上的发展，他们的思维就是‘Inside the box’”。     <br />2）"Out of the box"(开箱即用)也用作"off the shelf"（现货供应）的同义词，其含义是指能够满足一定需求的、已经作好了的软件、硬件或两者的结合形式。如不采用，就需要投入专门的人力物力来开发。</p>  <p>out-of-the-box具有“创造性的，独特性，思维不合常规”的意思，但在计算机术语里又可以指“从盒子里拿出来直接可以使用的，也就是即开即用”的意思。"out-of-the-box" is similar to "off-the-shelf",    <br />usually referinng to software/hardware which can be used as is, not requiring extra customisation or add-on components.”</p>  <p>转自:<a href="http://www.bokee.net/bloggermodule/blog_viewblog.do?id=1123819" target="_blank">bokee</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/Life-20091208-238.html]]></link><pubdate><![CDATA[2009-12-8 10:30:45]]></pubdate></item><item><title><![CDATA[WCF之消息队列问题]]></title><description><![CDATA[This Article is Published by Live Writer。<p>1.Q:<font color="#ff8000"><strong>此计算机上尚未安装消息队列</strong></font>。</p>  <p>A:控制面板 --> 添加或删除程序 --> 添加/删除Windows组件 --> 勾选消息队列 --> 点击详细信息,将包括MSMQ HTTP支持在内的子组件都勾选上 -->确定完成。</p>  <p>上述方法主要是针对XP操作系统,更多安装步骤参见:<a href="http://msdn.microsoft.com/zh-cn/library/aa967729.aspx" target="_blank">官方的安装“消息队列 (MSMQ)”</a></p>  <p>2.Q:<font color="#ff8000"><strong>消息队列服务不可用</strong></font>。</p>  <p>A:运行输入services.msc打开服务,找到Message Queuing服务,该服务主要用来为分布式异步消息应用程序提供通信基础结构,启动该服务即可解决消息队列服务不可用的问题。</p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091204-237.html]]></link><pubdate><![CDATA[2009-12-4 11:19:19]]></pubdate></item><item><title><![CDATA[WCF中的Binding模型简介]]></title><description><![CDATA[This Article is Published by Live Writer。<p><a href="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_2.png"><img title="image" height="264" alt="image" src="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_thumb.png" width="519" border="0" /></a></p>  <p><a href="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_4.png"><img title="image" height="281" alt="image" src="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_thumb_1.png" width="524" border="0" /></a></p>  <p><a href="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_6.png"><img title="image" height="259" alt="image" src="http://images.cnblogs.com/cnblogs_com/artech/WindowsLiveWriter/WCF18Binding_14BED/image_thumb_2.png" width="527" border="0" /></a></p>  <p>参见:<a href="http://dotnet.cnblogs.com/page/43947/">http://dotnet.cnblogs.com/page/43947/</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091129-236.html]]></link><pubdate><![CDATA[2009-11-29 16:35:37]]></pubdate></item><item><title><![CDATA[ZT-一行命令搞定没有Visual Studio2003(2005)时的手动编译命令]]></title><description><![CDATA[<strong>起因：</strong></p>  <p>有时可能会发生这样的情况，网站做好了，要在服务器上布署。布署中发现，有些地方代码需要小改，然而，在服务器或其他地方没有安装VS系列工具，但服务器上已安装有.net框架，此时仍然需要对已有项目的某些文件进行少量修改，并再次进行编译。此时，在服务器上安装VS系列开发工具并不可能，也不经济。那么下面的方法就可以派上用场了。</p>  <p><strong>（1）将下面一行保存到你项目所在的目录下一个名为：buid.bat文件中：</strong></p>  <p>%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe YourSolutionName.sln /t:Rebuild /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Build.log</p>  <p>关于buid.bat：前面名字可以随便取，后面一定是.bat，带bat后缀的是批处理文件。</p>  <p><strong>（2）运行此buid.bat文件。</strong></p>  <p>此时发现所在目录下多了PrecompiledWeb\工程名称\bin目录，下面有你需要的.dll。</p>  <p><strong></strong></p>  <p><strong>（3）再COPY到你的相关网站目录下即可。</strong></p>  <p><strong></strong></p>  <p>关于更多的MSBuild.exe命令及参数解释，这里就不多说，查一下MSDN或百度一下即可。</p>  <p>&#160;</p>  <p>补充:有时候从网站上down的demo只有源码，但是又不想通过IDE打开，直接通过msbuild生成也是可以的。</p>  <table cellspacing="0" cellpadding="0" width="700" border="1"><tbody>     <tr>       <td valign="top" width="58">语法:</td>        <td valign="top" width="689">MSBuild.exe [options] [project file]</td>     </tr>      <tr>       <td valign="top" width="58">说明:</td>        <td valign="top" width="689">在项目文件中生成指定的目标。如果未指定项目文件，则 MSBuild 在当前工作目录中搜索扩展名以“proj”结尾的文件，并使用该文件。</td>     </tr>      <tr>       <td valign="top" width="58">开关:</td>        <td valign="top" width="689">&#160;</td>     </tr>      <tr>       <td valign="top" width="58">         <p>/help&#160; </p>       </td>        <td valign="top" width="689">显示此用法信息。(缩写为: /? 或 /h)</td>     </tr>      <tr>       <td valign="top" width="58">         <p>/nologo&#160;&#160; </p>       </td>        <td valign="top" width="689">不显示启动版权标志和版权信息。</td>     </tr>      <tr>       <td valign="top" width="58">         <p>/version&#160;&#160; </p>       </td>        <td valign="top" width="689">仅显示版本信息。(缩写为: /ver)</td>     </tr>      <tr>       <td valign="top" width="58">         <p>@<file>&#160;&#160; </p>       </td>        <td valign="top" width="689">         <p>在文本文件中插入命令行设置。若要指定多个响应文件，请分别指定每个响应文件。</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/noautoresponse&#160;&#160; </p>       </td>        <td valign="top" width="689">不要自动包括 MSBuild.rsp 文件。(缩写为:/noautorsp)</td>     </tr>      <tr>       <td valign="top" width="58">         <p>/target:<targets> </p>       </td>        <td valign="top" width="689">         <p>在此项目中生成这些目标。请使用分号或逗号分隔多个目标，或者分别指定每个目标。(缩写为: /t)&#160; <br />示例:/target:Resources;Compile</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/property:<n>=<v></p>       </td>        <td valign="top" width="689">         <p>设置或重写这些项目级属性。<n> 为属性名，<v> 为属性值。请使用分号或逗号分隔多个属性，或者分别指定每个属性。(缩写为: /p)            <br />示例:/property:WarningLevel=2;OutDir=bin\Debug\</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/logger:<logger>&#160; </p>       </td>        <td valign="top" width="689">         <p>使用此记录器记录 MSBuild 中的事件。若要指定多个记录器，请分别指定每个记录器。            <br /><logger> 语法为:[<logger class>,]<logger assembly>[;<logger parameters>]             <br /><logger class> 语法为:[<partial or full namespace>.]<logger class name>             <br /><logger assembly> 语法为:{<assembly name>[,<strong name>] | <assembly file>}             <br /><logger parameters> 是可选的，并按键入的形式原样传递给记录器。(缩写为: /l)             <br />示例:/logger:XMLLogger,MyLogger,Version=1.0.2,Culture=neutral             <br />&#160;&#160;&#160;&#160; /logger:XMLLogger,C:\Loggers\MyLogger.dll;OutputAsHTML</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/verbosity:<level> </p>       </td>        <td valign="top" width="689">         <p>在事件日志中显示此级别的信息量。可用的详细级别有: q[uiet]、m[inimal]、n[ormal]、d[etailed] 和 diag[nostic]。(缩写为: /v)            <br />示例:/verbosity:quiet</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/console</p>          <p>logger</p>          <p>parameters:<parameters></p>       </td>        <td valign="top" width="689">控制台记录器的参数。(缩写为: /clp)          <p>可用的参数有:            <br />&#160;&#160;&#160;&#160; PerformanceSummary - 显示任务、目标和项目中花费的时间。             <br />&#160;&#160;&#160;&#160; NoSummary - 不在末尾显示错误和警告摘要。             <br />&#160;&#160;&#160;&#160; NoItemAndPropertyList - 不在每个项目生成的开始显示项和属性的列表。             <br />&#160; 示例:/consoleloggerparameters:PerformanceSummary;NoSummary</p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/noconsolelogger&#160; </p>       </td>        <td valign="top" width="689">         <p>禁用默认的控制台记录器并且不将事件记录到控制台。(缩写为: /noconlog) </p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/validate&#160; </p>       </td>        <td valign="top" width="689">         <p>&#160; 根据默认架构验证项目。(缩写为: /val) </p>       </td>     </tr>      <tr>       <td valign="top" width="58">         <p>/validate:<schema> </p>       </td>        <td valign="top" width="689">         <p>&#160; 根据指定架构验证项目。(缩写为: /val)            <br />&#160; 示例:/validate:MyExtendedBuildSchema.xsd</p>       </td>     </tr>   </tbody></table>  <p>示例: MSBuild MyApp.sln /t:Rebuild /p:Configuration=Release   <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; MSBuild MyApp.csproj /t:Clean /p:Configuration=Debug</p><br />
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091125-235.html]]></link><pubdate><![CDATA[2009-11-25 15:04:28]]></pubdate></item><item><title><![CDATA[IIS无法启动之发生意外错误0x8ffe2740]]></title><description><![CDATA[This Article is Published by Live Writer。<p><strong>解决方法     <br /></strong>要解决这个问题,您可以进行以下任一项操作:    <br />• 在IIS管理器中更改网站绑定端口为除80端口外的其它端口.&#160; <br />• 停止正在使用80端口的应用程序,然后从IIS管理器中启动网站. </p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091125-234.html]]></link><pubdate><![CDATA[2009-11-25 13:25:44]]></pubdate></item><item><title><![CDATA[SketchPath - The XPath Tool]]></title><description><![CDATA[This Article is Published by Live Writer。<p>I added another tool to my <a href="http://blogs.msdn.com/jjameson/archive/2007/03/22/backedup-and-notbackedup.aspx">Toolbox</a> yesterday: SketchPath.</p>  <p>The <a href="http://www.sketchpath.com/">SketchPath site</a> labels it as "The XPath Tool" but I'd say it more like "<em>The</em> XPath Tool."</p>  <p>I've seen a few other tools for quickly building and testing XPath expressions against an XML document, but they pale in comparison to SketchPath. There are a number of online tools that unquestionably require less effort to get started with, but you'll likely find them very limiting as well.</p>  <p>I know I'm not the only one who thinks SketchPath rocks. Scott Hanselman included it in his <a href="http://www.hanselman.com/blog/ScottHanselmans2009UltimateDeveloperAndPowerUsersToolListForWindows.aspx">2009 Ultimate Developer and Power Users Tool List for Windows</a>.</p>  <p>If you do any significant amount of work with XML, I recommend you download SketchPath today.</p>  <p>&#160;</p>  <p>Published Wednesday, November 18, 2009 4:40 AM by <a href="http://blogs.msdn.com/user/Profile.aspx?UserID=6212">Jeremy Jameson</a></p>  <p>Filed under: <a href="http://blogs.msdn.com/jjameson/archive/tags/Core+Development/default.aspx">Core Development</a></p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091118-233.html]]></link><pubdate><![CDATA[2009-11-18 22:03:46]]></pubdate></item><item><title><![CDATA[What&rsquo;s new in VS2010?]]></title><description><![CDATA[This Article is Published by Live Writer。<p>To see the highlights and what’s new in vs2010 please visit the follwing links: <a href="http://msdn.microsoft.com/en-us/library/dd547188(VS.100).aspx" target="_blank">Visual Studio 2010 Product Highlights</a> and <a href="http://msdn.microsoft.com/en-us/library/bb386063(VS.100).aspx" target="_blank">What's New in Visual Studio 2010</a>,<strong> </strong>especially <a href="http://msdn.microsoft.com/en-us/library/bb383815(VS.100).aspx" target="_blank">What's New in Visual C# 2010</a> and <a href="http://msdn.microsoft.com/en-us/library/dd409230(VS.100).aspx" target="_blank">What's New in the .NET Framework 4</a> !</p>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/CSharp-20091104-232.html]]></link><pubdate><![CDATA[2009-11-4 0:25:45]]></pubdate></item><item><title><![CDATA[解决&ldquo;远程下层文档&rdquo;病毒攻击打印机问题]]></title><description><![CDATA[This Article is Published by Live Writer。<p>今天客户打印时遇到了一个"远程下层文档"而导致无法打印的问题，Google了一下，在此引用<a href="http://840711.blog.51cto.com/69327/9010" target="_blank">Peadog</a>的文章，如下：</p>  <blockquote>   <h3>“</h3>    <p><strong></strong>前言：进来集团很多共享打印机出现打印文件名为“远程下层文档”的异常打印任务，导致打印机队列堵塞，无法清除打印任务，甚至无法删除打印机。</p>    <p>解决思路：</p>    <p>1.停止/启动打印池服务</p>    <p>在服务控制面板中，停止/启动<strong>print spooler</strong>服务；</p>    <p>2.删除打印池文件</p>    <p>删除<strong>C:\WINDOWS\system32\spool\PRINTERS</strong>中所有队列文件；</p>    <p>3.对共享打印机<strong>设置相关访问权限</strong>，拒绝无关病毒主机对其进行访问。</p>    <p>     <hr width="100%" size="1" /></p>    <p><strong>补充：</strong>感性不知名的“51cto游客”</p>    <p>有一点需要说明：在\spool\Pinters\ 项下的异常打印文件可能无法删除，系统提示有其他用户或进程在使用这些文件。此时打开Task manager，在进程中找到spoolsv.exe并删除之。之后可以顺利删除异常打印文件。</p>    <h3>”</h3></blockquote>
]]></description><author><![CDATA[Jack]]></author><link><![CDATA[http://www.dongpad.com/Life-20091102-231.html]]></link><pubdate><![CDATA[2009-11-2 10:04:53]]></pubdate></item></channel></rss>
