﻿<?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>博客园-zhanqiangz(闲云野鹤-Overriding)</title><link>http://www.cnblogs.com/netboy/</link><description>I love dotnet as I love you ! I play computer as I play basketball !
My name is zhanqiangz  !</description><language>zh-cn</language><lastBuildDate>Sun, 07 Sep 2008 13:48:05 GMT</lastBuildDate><pubDate>Sun, 07 Sep 2008 13:48:05 GMT</pubDate><ttl>60</ttl><item><title>BizTalk - How to create custom functoid.</title><link>http://www.cnblogs.com/netboy/archive/2008/05/29/1210351.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 29 May 2008 15:39:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2008/05/29/1210351.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/1210351.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2008/05/29/1210351.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/1210351.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/1210351.html</trackback:ping><description><![CDATA[摘要: Functoid is no more than a piece of .Net code, find my another post BizTalk-Get to know functoid for more detail. The functoids coming with BizTalk do not always satisfy your needs. How to create our own custom functoid? In this article, I want to create a functoid which get current date/date time based on given format.&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2008/05/29/1210351.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/1210351.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42134/" target="_blank">[新闻]JavaScript将成Silverlight的最大对手?</a>]]></description></item><item><title>BizTalk - Carefully use Send Port Group</title><link>http://www.cnblogs.com/netboy/archive/2008/05/29/1209649.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 29 May 2008 00:46:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2008/05/29/1209649.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/1209649.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2008/05/29/1209649.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/1209649.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/1209649.html</trackback:ping><description><![CDATA[摘要: You want BizTalk Server to send the same message to multiple downstream systems for further processing. Send Port Group is designed to serve this purpose.&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2008/05/29/1209649.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/1209649.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42134/" target="_blank">[新闻]JavaScript将成Silverlight的最大对手?</a>]]></description></item><item><title>BizTalk -  How to debug map in VS2005</title><link>http://www.cnblogs.com/netboy/archive/2008/05/09/1190623.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Fri, 09 May 2008 13:36:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2008/05/09/1190623.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/1190623.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2008/05/09/1190623.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/1190623.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/1190623.html</trackback:ping><description><![CDATA[摘要: I am here not talking about debugging BizTalk application with HAT, my topic is how to debug map in VS2005.&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2008/05/09/1190623.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/1190623.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42133/" target="_blank">[新闻]没有谷歌就活不下去的四个网站</a>]]></description></item><item><title>BizTalk-Get to know functoid.</title><link>http://www.cnblogs.com/netboy/archive/2008/05/08/1189043.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 08 May 2008 14:39:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2008/05/08/1189043.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/1189043.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2008/05/08/1189043.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/1189043.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/1189043.html</trackback:ping><description><![CDATA[摘要: This article is intended to give you a general idea about what’s functoid in BizTalk. Functoid is no more than a piece of .Net code...&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2008/05/08/1189043.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/1189043.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42132/" target="_blank">[新闻]Google 10周岁生日</a>]]></description></item><item><title>BizTalk - String Functoids</title><link>http://www.cnblogs.com/netboy/archive/2008/04/01/1132609.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 01 Apr 2008 04:49:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2008/04/01/1132609.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/1132609.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2008/04/01/1132609.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/1132609.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/1132609.html</trackback:ping><description><![CDATA[摘要: BizTalk - String Functoids&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2008/04/01/1132609.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/1132609.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42131/" target="_blank">[新闻]祝Google 10周岁生日快乐</a>]]></description></item><item><title>一辈子都忘不了的七夕节</title><link>http://www.cnblogs.com/netboy/archive/2007/08/19/861471.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Sun, 19 Aug 2007 02:28:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/08/19/861471.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/861471.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/08/19/861471.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/861471.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/861471.html</trackback:ping><description><![CDATA[摘要: 七夕对于大多数中国人来说只是传统的情人节，但是对我来说意义却非同寻常！去年的七夕我把新娘子迎回家，今年的七夕我在梦寐以求的新公司上班正好一周，今年的七夕是一个值得庆祝和总结工作的日子。&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/08/19/861471.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/861471.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42130/" target="_blank">[新闻]Google十年市值达1500亿美元 创造奇迹</a>]]></description></item><item><title>Head First Design patterns笔记－Singleton patterns (从“一夫一妻制社会中婚约的达成”看单件模式)</title><link>http://www.cnblogs.com/netboy/archive/2007/06/10/778115.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Sun, 10 Jun 2007 03:55:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/06/10/778115.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/778115.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/06/10/778115.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/778115.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/778115.html</trackback:ping><description><![CDATA[摘要: 在“一夫一妻”制的社会中，受道德约束，每个人（虽然本例是用girl’s engagement，但是实际不论对于男人或者女生都是成立的，^_^。）一旦有了婚约就不应该再接受其他的婚约。不知道现在还有没有“指腹为婚”和“娃娃亲”，虽然这与现在提倡的“婚姻自由，自主婚姻”等观念格格不入，但是与“一夫一妻”制度是没有冲突的，而且对于本例是很有用的。“指腹为婚”和“娃娃亲”映射到本例，就是early created singleton object，GirlsEngagement实例在外界访问以前已经存在了，所以大家不要再去试图追求一个从小就有了婚约的人。现实生活中并不是一个追求者去追一个被追求者这么简单，更多的时候可能是一对多的关系，多个人同时追求一个人（多线程问题），这个时候会出现非常非常多的问题，如果没有任何限制，这个被追求者同时有了多个婚约，后果真的不堪设想啊！轻则会有各种各样的纠纷，重则可能会搞得头破血流，你死我活。追求一个自己心仪的对象如果想更大可能性拿到婚约，最好是让别人知道某人正在被你追，但是这个时候你也要搞清楚，你喜欢的人是不是已经有了婚约，别跟大家说你要追某MM，结果发现人家&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/06/10/778115.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/778115.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42129/" target="_blank">[新闻]GMail:回过头来支持IE6</a>]]></description></item><item><title>Global.asax文件里的Application_Init能触发吗?</title><link>http://www.cnblogs.com/netboy/archive/2007/06/07/774879.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 07 Jun 2007 03:07:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/06/07/774879.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/774879.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/06/07/774879.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/774879.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/774879.html</trackback:ping><description><![CDATA[摘要: Global.asax文件里的Application_Init能触发吗?在项目中遇到一个bug,结果发现是因为把一些在整个web应用程序启动时应该执行的代码放到了Application_Init中,但是这个方法在web应用程序启动的过程中并没有触发.我用的环境是VSTS,不管是web site项目还是web application项目都是这样,也委托我的朋友在VS2003里做了验证,结果一样不能触发.你可以白度或者Google一下,关于Application_Init的文章很多,大多都说在web应用程序启动的时候触发,并且在整个生命周期只执行一次.下面的文章来源于网络:<br>&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/06/07/774879.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/774879.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42128/" target="_blank">[新闻]Google十年大变样</a>]]></description></item><item><title>使用HttpApplication实例(翻译)</title><link>http://www.cnblogs.com/netboy/archive/2007/05/25/759654.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Fri, 25 May 2007 05:25:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/05/25/759654.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/759654.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/05/25/759654.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/759654.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/759654.html</trackback:ping><description><![CDATA[摘要: 在应用程序的整个生命周期,ASP.NET都会维护一个由Global.asax派生(Global.asax-derived)出来的HttpApplication实例的池.当应用程序接到一个http请求,asp.net页面框架就会指派其中的一个HttpApplication实例来处理请求.这个特定的HttpApplication实例会负责管理这个请求的整个生命周期.这个实例也只能在当前请求完成后才可以被重用.通过HttpApplication类你可以通过编程的方式来访问HttpApplication.Init和HttpApplication.Dispose 方法以及Application_OnStart 和 Application_OnEnd 事件,并且你可以访问HttpModule的一些公开事件.(注:在msdn的IHttpModule相关文档中可以看到这个接口只有两个公开的方法接口一个是Dispose另一个是Init.)<br><br>&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/05/25/759654.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/759654.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42127/" target="_blank">[新闻]谷歌十年创新路</a>]]></description></item><item><title>Head First Design patterns笔记－Decorator Patterns (从”用不同技能武装自己”看装饰模式)</title><link>http://www.cnblogs.com/netboy/archive/2007/05/10/742255.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 10 May 2007 15:10:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/05/10/742255.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/742255.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/05/10/742255.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/742255.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/742255.html</trackback:ping><description><![CDATA[摘要: Head First Design patterns笔记－Decorator Patterns (从”用不同技能武装自己”看装饰模式)－－－学习是人类与生俱来的一种能力。当然像哭泣、微笑、吃饭、睡觉等能力人一来到这个世界就会。当你学习了一种技能你就会多一种行为能力。用不同的技能把自己武装起来，你就会成为一个”多才多艺”的人,^_^。就我自己而言，吃喝拉撒睡这些就不用再提了，小学四年纪的时候学会了游泳（在同伴当中应该算是学的很晚的），大约六年级的时候开始摸篮球，算起球龄来也差不多15年了，不能算高手中的低手至少也应该算是低手中的高手了（大学的时候也是靠球技迷倒一片的，^_^。稍微自恋一下）。大学修的计算机科学与技术，毕业来北京混饭吃做了一年多的开发。后来走投无路做了一年测试，最后还是脱离了枯燥的测试工作重新做开发。算起来这几项能力我也算都具备了，现在除了做好自己的开发工作，我也会协助同事做一些测试的工作，工作之余我会参加一些游泳，篮球的比赛活动，业余时间教我老婆这几项技能，^_^。这篇文章的例子正是模拟人与技能之间的这种关系，我的一个朋友一直做开发，现在正在学习游泳，基本不会打球，这个例&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/05/10/742255.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/742255.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42126/" target="_blank">[新闻]十年回顾：Google的互联网经济</a>]]></description></item><item><title>Head First Design patterns笔记－Observer Patterns (从TFS的Project alerts功能看观察者模式) </title><link>http://www.cnblogs.com/netboy/archive/2007/05/01/733906.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 01 May 2007 01:52:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/05/01/733906.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/733906.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/05/01/733906.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/733906.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/733906.html</trackback:ping><description><![CDATA[摘要: Head First Design patterns笔记－Observer Patterns (从TFS的Project alerts功能看观察者模式) . Team foundation server中提供了一个非常适用的功能就是project alerts.在team explorer中打开一个项目，右键菜单中有一个project alerts菜单项，点击会弹出一个对话框，你可以选择自己要接受的project alert的类别（发送project alert的一些规则）和自己的email地址，当当前项目发生的变化或者发生的事件满足上述你订阅的规则时，系统就会给你发送邮件通知你TFS中你所关心的项目发生了怎样的变化。想着跟踪项目中的变化，这应该是最方便的途径了，订阅了以后TFS会自动通知你相关的信息，你在也不会自己逐个文件查看是否发生了改变了。如果不在需要跟踪项目的信息，只要推订project alerts就可以了。<br>&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/05/01/733906.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/733906.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42123/" target="_blank">[新闻]Google 10周年大事记</a>]]></description></item><item><title>ASP.NET 2.0的编译行为</title><link>http://www.cnblogs.com/netboy/archive/2007/04/29/732519.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Sun, 29 Apr 2007 08:55:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/04/29/732519.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/732519.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/04/29/732519.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/732519.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/732519.html</trackback:ping><description><![CDATA[摘要: ASP.NET 2.0的编译行为. 在从ASP.NET1.1向2.0迁移的时候在如何生成debug和release的构建(builds)方面做了调整.&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/04/29/732519.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/732519.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42122/" target="_blank">[新闻]Google上下二十年</a>]]></description></item><item><title>Head First Design patterns笔记－Strategy Patterns (从不同的人使用不同的交通工具上班看策略模式)</title><link>http://www.cnblogs.com/netboy/archive/2007/04/25/727535.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Wed, 25 Apr 2007 14:57:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/04/25/727535.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/727535.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/04/25/727535.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/727535.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/727535.html</trackback:ping><description><![CDATA[摘要: Head First Design patterns笔记－Strategy Patterns (从不同的人使用不同的交通工具上班看策略模式)。  生活在北京，每天早晨当我骑着自行车走在上班的路上的时候都能看到和我一样行色匆匆的路人，自行车族还是占相当大的比例的，偶尔会有摩托车呼啸着从身边飞过，相当的嚣张。不过摩托车碰到满街的奥迪，宝马之类的就相形见绌了。开车也有抓瞎的时候，比如堵车了，我们自行车族完全可以绕着走或者从车缝里穿过去，基本不会有太多的影响，你们小轿车就得一直等到交通疏散开才可以，有本事你给我也从车缝里挤过去看看。^_^。交通工具一般能和人的职位头衔相对应起来，像我这样一穷二白的ITer大概也只能骑自行车了，稍微有点钱的可以弄个摩托车跑跑，当然一般老板都有自己的私家轿车。本文的例子就是讲老板，项目经理（我假定他们比较有钱，完全可以支付起使用摩托车的费用）和我们普通ITer选择自己的交通工具去上班。当然老板完全可以也骑自行车，这是合法的也是可行的。<br>&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/04/25/727535.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/727535.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42120/" target="_blank">[新闻]中华英才网面临外资吞并</a>]]></description></item><item><title>晕菜了,TFS居然把vss里的那个rollback功能cut掉了,还好有人写了工具.</title><link>http://www.cnblogs.com/netboy/archive/2007/04/17/716590.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 17 Apr 2007 04:51:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/04/17/716590.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/716590.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/04/17/716590.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/716590.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/716590.html</trackback:ping><description><![CDATA[用TFS这么长时间从来没用过rollback功能,昨天出了点问题想rollback一把,发现没有这个功能.网上搜了搜,果然ms及其不厚道把这个功能取消了,还好有牛人写了个工具<a title="Team Foundation PowerToys" href="http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx" target=_blank>Team Foundation PowerToys</a>,可以通过命令行或者GUI界面(部分命令)来扩展VSTF的功能,这个东东算是第三方软件吧,不受MS的支持,你可以从MS官方网站<a title=下载 href="http://www.microsoft.com/downloads/details.aspx?familyid=7324C3DB-658D-441B-8522-689C557D0A79&amp;displaylang=en" target=_blank>下载</a>. 
<img src ="http://www.cnblogs.com/netboy/aggbug/716590.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42119/" target="_blank">[新闻]软件收入百强张榜 华为中兴海尔列前三</a>]]></description></item><item><title>使用性能计数器检测应用程序的性能！</title><link>http://www.cnblogs.com/netboy/archive/2007/04/12/711355.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 12 Apr 2007 14:54:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/04/12/711355.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/711355.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/04/12/711355.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/711355.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/711355.html</trackback:ping><description><![CDATA[摘要: 1．创建一个简单的web service,这个演示程序就是把客户端对web service中的两个webmethod总访问量，每秒访问量，总出错次数，每秒出错次数以及调用延迟的情况在性能计数器中显示出来，web service中的代码相当简单，事实上基本上看不到延迟的存在，这也只是为了演示用。1usingSystem;2usingSystem.Web;3usingSystem.Web.Servic&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/04/12/711355.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/711355.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42117/" target="_blank">[新闻]马云vs孙正义：两个“疯子”的对话</a>]]></description></item><item><title>如何使用后台代码在head标记中动态生成javascript?</title><link>http://www.cnblogs.com/netboy/archive/2007/04/11/709365.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Wed, 11 Apr 2007 10:30:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/04/11/709365.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/709365.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/04/11/709365.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/709365.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/709365.html</trackback:ping><description><![CDATA[&nbsp;<span>利用</span><span>c#</span><span>后台注册</span><span>js</span><span>的技术大家都快用烂了</span><span>,</span><span>但是有时候我们想把</span><span>js</span><span>脚本添加到</span><span>head</span><span>中而不是在</span><span>body</span><span>中</span><span>,</span><span>怎么办呢</span><span>?<br></span><span>.net framework2.0</span><span>为我们提供了一些便利</span><span>,</span><span>大家可以尝试使用一下</span><span>HtmlHead,</span><span>这个东东正是我们所需要的</span><span>.<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">&nbsp;1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br></span><span style="COLOR: #008080">&nbsp;2</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Data;<br></span><span style="COLOR: #008080">&nbsp;3</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Configuration;<br></span><span style="COLOR: #008080">&nbsp;4</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections;<br></span><span style="COLOR: #008080">&nbsp;5</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web;<br></span><span style="COLOR: #008080">&nbsp;6</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.Security;<br></span><span style="COLOR: #008080">&nbsp;7</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI;<br></span><span style="COLOR: #008080">&nbsp;8</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.WebControls;<br></span><span style="COLOR: #008080">&nbsp;9</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.WebControls.WebParts;<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.UI.HtmlControls;<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Default2&nbsp;:&nbsp;System.Web.UI.Page<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img id=Codehighlighter1_314_645_Open_Image onclick="this.style.display='none'; Codehighlighter1_314_645_Open_Text.style.display='none'; Codehighlighter1_314_645_Closed_Image.style.display='inline'; Codehighlighter1_314_645_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_314_645_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_314_645_Closed_Text.style.display='none'; Codehighlighter1_314_645_Open_Image.style.display='inline'; Codehighlighter1_314_645_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_314_645_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_314_645_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;Page_Load(</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img id=Codehighlighter1_377_643_Open_Image onclick="this.style.display='none'; Codehighlighter1_377_643_Open_Text.style.display='none'; Codehighlighter1_377_643_Closed_Image.style.display='inline'; Codehighlighter1_377_643_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_377_643_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_377_643_Closed_Text.style.display='none'; Codehighlighter1_377_643_Open_Image.style.display='inline'; Codehighlighter1_377_643_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_377_643_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_377_643_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;script&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">@"</span><span style="COLOR: #000000">&lt;script&nbsp;language='javascript'&nbsp;type='text/javascript'&gt;document.write('this&nbsp;client&nbsp;script&nbsp;is&nbsp;created&nbsp;by&nbsp;back&nbsp;end&nbsp;code,&nbsp;and&nbsp;it&nbsp;is&nbsp;placed&nbsp;in&nbsp;head&nbsp;tag!')&lt;/script&gt;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HtmlHead&nbsp;header&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;Page.Header;<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header.InnerHtml&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;script;<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span></div>
</span>查看一下客户端代码都什么东东:<br><img style="WIDTH: 626px; HEIGHT: 176px" height=176 alt="" src="http://www.cnblogs.com/images/cnblogs_com/netboy/source.PNG" width=626 border=0><br><br><span style="COLOR: red">主意我用的是HtmlHead.InnerHtml,有其他的属性自己可以试试,另外HtmlTitle和HtmlMeta也是2.0里的新东西,好多时候可以为我们后台控制提供方便.</span> 
<img src ="http://www.cnblogs.com/netboy/aggbug/709365.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42116/" target="_blank">[新闻]消息称MySQL创始人已向Sun提交辞呈</a>]]></description></item><item><title>web service类什么时候初始化?</title><link>http://www.cnblogs.com/netboy/archive/2007/03/26/688472.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Mon, 26 Mar 2007 06:53:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/03/26/688472.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/688472.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/03/26/688472.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/688472.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/688472.html</trackback:ping><description><![CDATA[下面的这个例子演示了web service是如何初始化的:<br>1.创建测试用的web service.<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">&nbsp;1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br></span><span style="COLOR: #008080">&nbsp;2</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web;<br></span><span style="COLOR: #008080">&nbsp;3</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.Services;<br></span><span style="COLOR: #008080">&nbsp;4</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Web.Services.Protocols;<br></span><span style="COLOR: #008080">&nbsp;5</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.IO;<br></span><span style="COLOR: #008080">&nbsp;6</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">&nbsp;7</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>[WebService(Namespace&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">http://tempuri.org/</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">)]<br></span><span style="COLOR: #008080">&nbsp;8</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top>[WebServiceBinding(ConformsTo&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;WsiProfiles.BasicProfile1_1)]<br></span><span style="COLOR: #008080">&nbsp;9</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Service&nbsp;:&nbsp;System.Web.Services.WebService<br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img id=Codehighlighter1_278_982_Open_Image onclick="this.style.display='none'; Codehighlighter1_278_982_Open_Text.style.display='none'; Codehighlighter1_278_982_Closed_Image.style.display='inline'; Codehighlighter1_278_982_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_278_982_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_278_982_Closed_Text.style.display='none'; Codehighlighter1_278_982_Open_Image.style.display='inline'; Codehighlighter1_278_982_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_278_982_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_278_982_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;counter&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Service()<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img id=Codehighlighter1_341_727_Open_Image onclick="this.style.display='none'; Codehighlighter1_341_727_Open_Text.style.display='none'; Codehighlighter1_341_727_Closed_Image.style.display='inline'; Codehighlighter1_341_727_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_341_727_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_341_727_Closed_Text.style.display='none'; Codehighlighter1_341_727_Open_Image.style.display='inline'; Codehighlighter1_341_727_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_341_727_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_341_727_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">Uncomment&nbsp;the&nbsp;following&nbsp;line&nbsp;if&nbsp;using&nbsp;designed&nbsp;components&nbsp;<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">InitializeComponent();&nbsp;</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">17</span><span style="COLOR: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;counter</span><span style="COLOR: #000000">++</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;(System.IO.StreamWriter&nbsp;w&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;File.AppendText(</span><span style="COLOR: #000000">@"</span><span style="COLOR: #000000">c:\a\time.txt</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">))<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img id=Codehighlighter1_553_712_Open_Image onclick="this.style.display='none'; Codehighlighter1_553_712_Open_Text.style.display='none'; Codehighlighter1_553_712_Closed_Image.style.display='inline'; Codehighlighter1_553_712_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_553_712_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_553_712_Closed_Text.style.display='none'; Codehighlighter1_553_712_Open_Image.style.display='inline'; Codehighlighter1_553_712_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_553_712_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_553_712_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w.WriteLine(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">You&nbsp;have&nbsp;called&nbsp;this&nbsp;webservice&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">counter.ToString()&nbsp;&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;times,&nbsp;the&nbsp;lates&nbsp;call&nbsp;happened&nbsp;at:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;DateTime.Now.ToString());<br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;[WebMethod]<br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;HelloWorld(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;name)<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img id=Codehighlighter1_792_876_Open_Image onclick="this.style.display='none'; Codehighlighter1_792_876_Open_Text.style.display='none'; Codehighlighter1_792_876_Closed_Image.style.display='inline'; Codehighlighter1_792_876_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_792_876_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_792_876_Closed_Text.style.display='none'; Codehighlighter1_792_876_Open_Image.style.display='inline'; Codehighlighter1_792_876_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_792_876_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_792_876_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">currentMethod&nbsp;=&nbsp;"HelloWord";</span><span style="COLOR: #008000"><br></span><span style="COLOR: #008080">29</span><span style="COLOR: #008000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Hello&nbsp;World:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;name;<br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;[WebMethod]<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;Welcome(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">&nbsp;name)<br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img id=Codehighlighter1_937_979_Open_Image onclick="this.style.display='none'; Codehighlighter1_937_979_Open_Text.style.display='none'; Codehighlighter1_937_979_Closed_Image.style.display='inline'; Codehighlighter1_937_979_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_937_979_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_937_979_Closed_Text.style.display='none'; Codehighlighter1_937_979_Open_Image.style.display='inline'; Codehighlighter1_937_979_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_937_979_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_937_979_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">34</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Welcome:&nbsp;</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #000000">+</span><span style="COLOR: #000000">&nbsp;name;<br></span><span style="COLOR: #008080">35</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">36</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">37</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">38</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span></div>
从代码中可以看出,在服务器的构造函数中只是在一个文件中记录了当前服务器的时间和一共调用了web service的次数.<br><span style="COLOR: red">注意:必须给对应的目录添加对ASPNET帐号的写权限,否则会出现访问拒绝的异常.<br></span><br>2.创建客户端测试代码<br>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">&nbsp;1</span><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System;<br></span><span style="COLOR: #008080">&nbsp;2</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Collections.Generic;<br></span><span style="COLOR: #008080">&nbsp;3</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.ComponentModel;<br></span><span style="COLOR: #008080">&nbsp;4</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Data;<br></span><span style="COLOR: #008080">&nbsp;5</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Drawing;<br></span><span style="COLOR: #008080">&nbsp;6</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Text;<br></span><span style="COLOR: #008080">&nbsp;7</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Windows.Forms;<br></span><span style="COLOR: #008080">&nbsp;8</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">using</span><span style="COLOR: #000000">&nbsp;System.Net;<br></span><span style="COLOR: #008080">&nbsp;9</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><br></span><span style="COLOR: #008080">10</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">namespace</span><span style="COLOR: #000000">&nbsp;WSTest<br></span><span style="COLOR: #008080">11</span><span style="COLOR: #000000"><img id=Codehighlighter1_201_690_Open_Image onclick="this.style.display='none'; Codehighlighter1_201_690_Open_Text.style.display='none'; Codehighlighter1_201_690_Closed_Image.style.display='inline'; Codehighlighter1_201_690_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_201_690_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_201_690_Closed_Text.style.display='none'; Codehighlighter1_201_690_Open_Image.style.display='inline'; Codehighlighter1_201_690_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_201_690_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_201_690_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">12</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;partial&nbsp;</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">&nbsp;Form1&nbsp;:&nbsp;Form<br></span><span style="COLOR: #008080">13</span><span style="COLOR: #000000"><img id=Codehighlighter1_245_688_Open_Image onclick="this.style.display='none'; Codehighlighter1_245_688_Open_Text.style.display='none'; Codehighlighter1_245_688_Closed_Image.style.display='inline'; Codehighlighter1_245_688_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_245_688_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_245_688_Closed_Text.style.display='none'; Codehighlighter1_245_688_Open_Image.style.display='inline'; Codehighlighter1_245_688_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_245_688_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_245_688_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">14</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;localhost.Service&nbsp;s&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">null</span><span style="COLOR: #000000">;<br></span><span style="COLOR: #008080">15</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">&nbsp;Form1()<br></span><span style="COLOR: #008080">16</span><span style="COLOR: #000000"><img id=Codehighlighter1_314_400_Open_Image onclick="this.style.display='none'; Codehighlighter1_314_400_Open_Text.style.display='none'; Codehighlighter1_314_400_Closed_Image.style.display='inline'; Codehighlighter1_314_400_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_314_400_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_314_400_Closed_Text.style.display='none'; Codehighlighter1_314_400_Open_Image.style.display='inline'; Codehighlighter1_314_400_Open_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_314_400_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cnblogs.com/Images/dot.gif"></span><span id=Codehighlighter1_314_400_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">17</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br></span><span style="COLOR: #008080">18</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">&nbsp;localhost.Service();<br></span><span style="COLOR: #008080">19</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">20</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">21</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;btnHelloWorld_Click(</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br></span><span style="COLOR: #008080">22</span><span style="COLOR: #000000"><img id=Codehighlighter1_480_540_Open_Image onclick="this.style.display='none'; Codehighlighter1_480_540_Open_Text.style.display='none'; Codehighlighter1_480_540_Closed_Image.style.display='inline'; Codehighlighter1_480_540_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_480_540_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_480_540_Closed_Text.style.display='none'; Codehighlighter1_480_540_Open_Image.style.display='inline'; Codehighlighter1_480_540_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_480_540_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_480_540_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">23</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show(s.HelloWorld(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">zzq</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br></span><span style="COLOR: #008080">24</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">25</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">26</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">&nbsp;</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;btnWelcome_Click(</span><span style="COLOR: #0000ff">object</span><span style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br></span><span style="COLOR: #008080">27</span><span style="COLOR: #000000"><img id=Codehighlighter1_617_674_Open_Image onclick="this.style.display='none'; Codehighlighter1_617_674_Open_Text.style.display='none'; Codehighlighter1_617_674_Closed_Image.style.display='inline'; Codehighlighter1_617_674_Closed_Text.style.display='inline';" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_617_674_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_617_674_Closed_Text.style.display='none'; Codehighlighter1_617_674_Open_Image.style.display='inline'; Codehighlighter1_617_674_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_617_674_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_617_674_Open_Text><span style="COLOR: #000000">{<br></span><span style="COLOR: #008080">28</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show(s.Welcome(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">zzq</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">));<br></span><span style="COLOR: #008080">29</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">30</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top><br></span><span style="COLOR: #008080">31</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br></span><span style="COLOR: #008080">32</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br></span><span style="COLOR: #008080">33</span><span style="COLOR: #000000"><img src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div>
<p>只是一个简单的win form程序,你可以通过两个按钮按不同的次序调用两个web method,然后看生成的文件里记录的信息.<br><br>3.下面是生成的文本文件的截图.</p>
<p>.<img height=212 alt=图片错误 src="http://www.cnblogs.com/images/cnblogs_com/netboy/result.PNG" width=755 border=0><br><br>4. 结论<br>&nbsp;web service在每一个请求来之前都会重新初始化一次,每调用其中的一个web method都会造成web service被重新初始化.<br></p>
<img src ="http://www.cnblogs.com/netboy/aggbug/688472.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42115/" target="_blank">[新闻]谷歌Chrome浏览器即将更换LOGO颜色？</a>]]></description></item><item><title>AJAX 网上资源</title><link>http://www.cnblogs.com/netboy/archive/2007/02/08/644850.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 08 Feb 2007 06:22:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/02/08/644850.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/644850.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/02/08/644850.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/644850.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/644850.html</trackback:ping><description><![CDATA[<span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial"><span style="mso-list: Ignore">
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial; mso-font-kerning: 0pt">1.</span><span lang=EN-US style="FONT-SIZE: 7pt; mso-fareast-font-family: Arial; mso-font-kerning: 0pt"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-font-kerning: 0pt">ASP.NET AJAX Documentation is now available to <a href="http://ajax.asp.net/documentation/default.aspx?tabid=47"><span style="COLOR: purple; mso-bidi-font-size: 12.0pt">download</span></a>. You can deploy it on your own box for easy browsing.</span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-fareast-font-family: Arial; mso-font-kerning: 0pt">2.</span><span lang=EN-US style="FONT-SIZE: 7pt; mso-fareast-font-family: Arial; mso-font-kerning: 0pt"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-font-kerning: 0pt">ASP.NET AJAX official web site:<a href="http://ajax.asp.net/"><span style="COLOR: purple; mso-bidi-font-size: 12.0pt">http://ajax.asp.net/</span></a> </span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">3.</span><span lang=EN-US style="FONT-SIZE: 7pt; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: Arial; mso-bidi-font-size: 10.0pt; mso-font-kerning: 0pt">Access <a href="http://weblogs.asp.net/scottgu/"><span style="COLOR: purple; mso-bidi-font-size: 12.0pt">ScottGu's Blog</span></a> to learn about the latest web-based technology; also you can visit the <a href="http://blog.joycode.com/scottgu/"><span style="COLOR: purple; mso-bidi-font-size: 12.0pt">Chinese version</span></a>.</span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">4.</span><span lang=EN-US style="FONT-SIZE: 7pt; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&nbsp;<st1:city w:st="on"><st1:place w:st="on">Ajax</st1:place></st1:city> related blogs from cnblogs: <a href="http://dflying.cnblogs.com/"><span style="COLOR: purple">http://dflying.cnblogs.com/</span></a> <span style="mso-spacerun: yes">&nbsp;</span><a href="http://www.cnblogs.com/Terrylee/archive/2006/11/12/ASPNET_AJAX_QuickStarts.html"><span style="COLOR: purple">http://www.cnblogs.com/Terrylee/archive/2006/11/12/ASPNET_AJAX_QuickStarts.html</span></a></span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体"><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">5.</span><span lang=EN-US style="FONT-SIZE: 7pt; mso-fareast-font-family: 'Times New Roman'; mso-no-proof: yes; mso-font-kerning: 0pt"><font face="Times New Roman">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">WebCasts on <a href="http://channel9.msdn.com/"><span style="COLOR: purple">http://channel9.msdn.com/</span></a>.<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">6</span><span style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">．<span lang=EN-US><a href="http://ajaxpatterns.org/Patterns">http://ajaxpatterns.org/Patterns</a><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align=left><span lang=EN-US style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">7</span><span style="FONT-SIZE: 12pt; FONT-FAMILY: 宋体; mso-no-proof: yes; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">．<span lang=EN-US><a href="http://www.w3schools.com/ajax/default.asp">http://www.w3schools.com/ajax/default.asp</a><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"></span></span></p>
<img src ="http://www.cnblogs.com/netboy/aggbug/644850.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42101/" target="_blank">[新闻]淘宝网合并阿里妈妈 专家称阿里巴巴或有新战略</a>]]></description></item><item><title>(转载)c# from a Java developer's perspective</title><link>http://www.cnblogs.com/netboy/archive/2007/01/04/611137.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 04 Jan 2007 03:18:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2007/01/04/611137.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/611137.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2007/01/04/611137.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/611137.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/611137.html</trackback:ping><description><![CDATA[摘要: A COMPARISON OFMICROSOFT'S C# PROGRAMMING LANGUAGETO SUN MICROSYSTEMS' JAVA PROGRAMMING LANGUAGEByDare Obasanjo IntroductionThe C# language is an object-oriented language that is aimed at enabling pro&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2007/01/04/611137.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/611137.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42096/" target="_blank">[新闻]微软研究院发布 AutoCollage - 整理并融合照片</a>]]></description></item><item><title>Web Services中的异常处理</title><link>http://www.cnblogs.com/netboy/archive/2006/12/06/584334.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Wed, 06 Dec 2006 08:58:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/12/06/584334.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/584334.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/12/06/584334.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/584334.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/584334.html</trackback:ping><description><![CDATA[See <a title="Exception Handling in Web Services" href="http://www.developer.com/net/csharp/article.php/10918_3088231_1" target=_blank>Exception Handling in Web Services</a>&nbsp;and <a title="Handling and Throwing Exceptions in XML Web Services" href="http://msdn2.microsoft.com/en-us/library/ds492xtk.aspx" target=_blank>Handling and Throwing Exceptions in XML Web Services</a>.
<img src ="http://www.cnblogs.com/netboy/aggbug/584334.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42100/" target="_blank">[新闻]2008年9月5日科技博客精选</a>]]></description></item><item><title>Visual Basic 8.0 和 C# 2.0语言增强</title><link>http://www.cnblogs.com/netboy/archive/2006/06/27/436626.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 27 Jun 2006 01:51:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/06/27/436626.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/436626.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/06/27/436626.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/436626.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/436626.html</trackback:ping><description><![CDATA[从&lt;&lt;professional asp.net2.0&gt;&gt;上翻译了一段。<br><br><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">&nbsp;&nbsp; 随着</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">.net2.0</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">的发布好多东西都发生了变化。不仅</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">ASP.NET</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">本身发生了变化，</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">IDE</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">也有了巨大的改变，</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">windows</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">窗体，</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">visual basic, c#</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">以及其他。因为</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">visual basic</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">和</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">c#</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">是</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">ASP.NET</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">开发最为常用的两种语言，所以这一章将重点讲述</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">Visual basic</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">和</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">C#</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">的变化。由于这两种语言在</span><span lang=EN-US style="FONT-FAMILY: Palatino-Roman; mso-font-kerning: 0pt; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman"><font face="Times New Roman">web</font></span><span style="FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-ascii-font-family: Palatino-Roman; mso-hansi-font-family: Palatino-Roman; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman">应用开发中大量运用，理解语言本身的特性和其所代表的方向将至关重要</span><br><a style="BACKGROUND-COLOR: #00ff00" href="http://blog.csdn.net/zhanqiangz/archive/2006/06/26/837484.aspx" target=_blank>http://blog.csdn.net/zhanqiangz/archive/2006/06/26/837484.aspx</a>
<img src ="http://www.cnblogs.com/netboy/aggbug/436626.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42099/" target="_blank">[新闻]SNS网站风靡影响工作效率 公司下令封杀</a>]]></description></item><item><title>ADO.NET2.0 异步处理的三种方式－函数回调法 </title><link>http://www.cnblogs.com/netboy/archive/2006/06/20/431016.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 20 Jun 2006 14:47:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/06/20/431016.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/431016.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/06/20/431016.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/431016.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/431016.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt">下面的代码用内嵌<span lang=EN-US>sql</span>语句方式通过调用<span lang=EN-US>BeginExecuteReader</span>取出前五条数据，并且把<span lang=EN-US>callback</span>的代理传给这个方法。</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt">不需要其他的处理，当这个异步调用结束时回调函数将被触发，并且取出结果集显示在屏幕上。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Page Language=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>C#</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Data</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Data.SqlClient</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Configuration</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;script runat=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>server</span>&#8221;<span lang=EN-US>&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">protected void Page_Load(object sender, EventArgs e)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlConnection DBCon;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlCommand Command = new SqlCommand();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlAsyncResult ASyncResult;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon = new SqlConnection();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command = new SqlCommand();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon.ConnectionString =<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">ConfigurationManager.ConnectionStrings[</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US>DSN_NorthWind</span>&#8221;<span lang=EN-US>].ConnectionString;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Selecting top 5 records from the Orders table<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.CommandText =<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: FranklinGothic-Book; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US>SELECT TOP 5 Customers.CompanyName, Customers.ContactName, </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span>&nbsp;<br>&nbsp;<span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> Orders.OrderID, Orders.OrderDate, </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> Orders.RequiredDate, Orders.ShippedDate </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> FROM Orders, Customers </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> WHERE Orders.CustomerID = Customers.CustomerID </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> ORDER BY Customers.CompanyName, Customers.ContactName </span>&#8220;<span lang=EN-US>;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.CommandType = CommandType.Text;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.Connection = DBCon;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon.Open();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Starting the asynchronous processing<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">AsyncResult = Command.BeginExecuteReader(new AsyncCallback(CBMethod),<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">CommandBehavior.CloseConnection);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">public void CBMethod(SQLAsyncResult ar)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlDataReader OrdersReader;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Retrieving result from the asynchronous process<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">OrdersReader = ar.EndExecuteReader(ar);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Displaying result on the screen<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">gvOrders.DataSource = OrdersReader;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">gvOrders.DataBind();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;/script&gt;<br><br><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><o:p></o:p></span></p>
<span>回调函数可以让你在代码的其他部分来处理命令执行的结果。这种特性在命令执行过程比一般的长但是你不想让用户等待过程调用结束时会非常有用。<span lang=EN-US><o:p></o:p></span></span>
<p>&nbsp;</p>
<img src ="http://www.cnblogs.com/netboy/aggbug/431016.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42098/" target="_blank">[新闻]《孢子》正式发布</a>]]></description></item><item><title>ADO.NET2.0 异步处理的三种方式－wait方法</title><link>http://www.cnblogs.com/netboy/archive/2006/06/20/431012.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 20 Jun 2006 14:42:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/06/20/431012.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/431012.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/06/20/431012.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/431012.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/431012.html</trackback:ping><description><![CDATA[摘要: Wait方法是三种异步调用方法中最为优雅的一种，这种方法提供了高度的灵活性，高效性，当然也稍微复杂一点。使用这种方法可以开始多个异步过程然后等待其中任何或者过程调用结束。使用这种方法你可以只等待那些相互依赖的过程，处理那些不和其他过程依赖的异步过程。这种方法在设计上要求考虑异步过程的细节，你必须慎重判断哪些异步过程是相互依赖的，哪些不是。这种方法的复杂性在于你必须理解其细节并且做出对应的设计。这是&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2006/06/20/431012.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/431012.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42098/" target="_blank">[新闻]《孢子》正式发布</a>]]></description></item><item><title>ADO.NET2.0 异步处理的三种方式－轮循检测法</title><link>http://www.cnblogs.com/netboy/archive/2006/06/20/431008.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Tue, 20 Jun 2006 14:36:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/06/20/431008.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/431008.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/06/20/431008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/431008.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/431008.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=center><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><strong>概述</strong><br><br><strong>一</strong> 开始一个异步过程，然后轮循检测异步过程返回的<span lang=EN-US>IAsyncResult</span>对象来判断过程调用是否结束。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><strong>二</strong> 为异步过程提供一个回调函数。这种方法可以让你并行处理其他的任务。当异步过程结束时，回调函数被 触发用来处理过程结束后的清理工作以及通知程序的其他部分该异步过程已经结束。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><strong>三</strong> 第三种方法使用<span lang=EN-US>wait handle</span>来处理异步过程，这是三种方法中最优雅的方法。使用这种方法你可以开启你想开启的所有异步过程，然后等待其中任何或者全部过程结束以便于做对应的处理。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: FranklinGothic-Medium; mso-font-kerning: 0pt"><strong>轮循检测法<span lang=EN-US><o:p></o:p></span></strong></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: FranklinGothic-Medium; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt">下面的代码用内嵌<span lang=EN-US>sql</span>语句的办法取出<span lang=EN-US>Northwind</span>数据库中<span lang=EN-US>Orders</span>表中的前五条数据。可以通过调用<span lang=EN-US>BeginExecuteReader</span>来开始一个异步过程，接下来用一个循环来等到过程结束。在等待的时候主线程会每休眠<span lang=EN-US>10</span>毫秒后检测异步过程返回的结果来判断过程调用是否结束。当过程结束时用</span><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">EndExecuteReader</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">来返回结果集。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: FranklinGothic-Demi; mso-font-kerning: 0pt">C#<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Page Language=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>C#</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Data</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Data.SqlClient</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;%@ Import Namespace=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>System.Configuration</span>&#8221;<span lang=EN-US> %&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;script runat=</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8221;<span lang=EN-US>server</span>&#8221;<span lang=EN-US>&gt;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">protected void Page_Load(object sender, EventArgs e)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlConnection DBCon;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlCommand Command = new SqlCommand();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">SqlDataReader OrdersReader;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">IAsyncResult ASyncResult;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon = new SqlConnection();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon.ConnectionString =<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">ConfigurationManager.ConnectionStrings[</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US>DSN_NorthWind</span>&#8221;<span lang=EN-US>].ConnectionString;<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.CommandText =<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US>SELECT TOP 5 Customers.CompanyName, Customers.ContactName, </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> Orders.OrderID, Orders.OrderDate, </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> Orders.RequiredDate, Orders.ShippedDate </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> FROM Orders, Customers </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> WHERE Orders.CustomerID = Customers.CustomerID </span>&#8220;<span lang=EN-US> +<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&#8220;<span lang=EN-US> ORDER BY Customers.CompanyName, Customers.ContactName </span>&#8220;<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.CommandType = CommandType.Text;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">Command.Connection = DBCon;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon.Open();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Starting the asynchronous processing<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">ASyncResult = Command.BeginExecuteReader();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// This loop with keep the main thread waiting until the<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// asynchronous process is finished<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">while (!ASyncResult.IsCompleted)<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Sleeping current thread for 10 milliseconds<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">System.Threading.Thread.Sleep(10);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Retrieving result from the asynchronous process<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">OrdersReader = Command.EndExecuteReader(ASyncResult);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Displaying result on the screen<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">gvOrders.DataSource = OrdersReader;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">gvOrders.DataBind();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">// Closing connection<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">DBCon.Close();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: WileyCode-Regular; mso-font-kerning: 0pt">&lt;/script&gt;<br><br><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 10.5pt; mso-bidi-font-family: Palatino-Roman; mso-font-kerning: 0pt">如果你在<span lang=EN-US>while</span>循环中打个断点，你会发现调用<span lang=EN-US>BeginExecuteReader</span>方法后代码会继续执行直到异步调用结束。<span lang=EN-US><o:p></o:p></span></span></p>
<img src ="http://www.cnblogs.com/netboy/aggbug/431008.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42098/" target="_blank">[新闻]《孢子》正式发布</a>]]></description></item><item><title>可以继承构造函数访问域是private的基类吗？</title><link>http://www.cnblogs.com/netboy/archive/2006/05/11/397703.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 11 May 2006 13:46:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/05/11/397703.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/397703.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/05/11/397703.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/397703.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/397703.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 突然想起这么个问题，可以继承构造函数是private的基类吗？由于生成子类的一个实例的时候是首先调用基类的构造函数的，但是基类的构造函数子类是不可访问的，所以理论来说不可以的。下面一点演示代码：<br>&nbsp;class BaseClass<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private BaseClass()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("parent class");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; class ChildClass:BaseClass<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public ChildClass()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MessageBox.Show("child");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>你无需运行生成子类实例的代码，只要build就能发现编译时的错误：WindowsApplication1.BaseClass.BaseClass()' is inaccessible due to its protection level&nbsp;。<br><br>很小很简单的问题，但是我相信不是每个程序员都能毫不犹豫地说出正确答案。^_^！<br>
<img src ="http://www.cnblogs.com/netboy/aggbug/397703.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42097/" target="_blank">[新闻]微软CFO:仍对收购雅虎搜索业务感兴趣</a>]]></description></item><item><title>DataGrid中的级联菜单</title><link>http://www.cnblogs.com/netboy/archive/2006/04/27/386230.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Thu, 27 Apr 2006 01:22:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/04/27/386230.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/386230.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/04/27/386230.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/386230.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/386230.html</trackback:ping><description><![CDATA[摘要: 要点：1&gt;通过一个隐藏的页面根据传递的参数从数据源获取数据，并且写到网络流中。2&gt;在主页面通过javascript+xmlhttp根据一级菜单提供的参数（省的代码）向隐藏页面发送请求，并且解析返回的响应，并且动态添加到二级菜单中。3&gt;由于DropDownList是在DataGrid模板中，因此DropDownList的ID是不确定的，因此需要用js根据父菜单的ID来动态生成子菜单&nbsp;&nbsp;<a href='http://www.cnblogs.com/netboy/archive/2006/04/27/386230.html'>阅读全文</a><img src ="http://www.cnblogs.com/netboy/aggbug/386230.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/42095/" target="_blank">[新闻]SQL Server2008十月亮相 标榜智能数据平台</a>]]></description></item><item><title>Nullable类型简介</title><link>http://www.cnblogs.com/netboy/archive/2006/04/21/381795.html</link><dc:creator>zhanqiangz(闲云野鹤)</dc:creator><author>zhanqiangz(闲云野鹤)</author><pubDate>Fri, 21 Apr 2006 15:08:00 GMT</pubDate><guid>http://www.cnblogs.com/netboy/archive/2006/04/21/381795.html</guid><wfw:comment>http://www.cnblogs.com/netboy/comments/381795.html</wfw:comment><comments>http://www.cnblogs.com/netboy/archive/2006/04/21/381795.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/netboy/comments/commentRss/381795.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/netboy/services/trackbacks/381795.html</trackback:ping><description><![CDATA[<p align=left>摘要<br><br><o:p></o:p></p>
<p>在.net1.x中处理值类型（value-types）的空值是比较困难的。在.NET2.0中可以借助泛型和Nullable类型来克服这一缺点。这篇文章给你示范什么是Nullable类型以及如何使用。<o:p></o:p></p>
<p><o:p>&nbsp;</o:p>使用Nullable类型的场合<br><br><o:p></o:p></p>
<p align=left>假想一种情况在你的代码中要保存货币的数值。现在的软件是严格的数学规则驱动的，一般需要量化所使用的变量。这就是为什么在.NET中每种类型都有默认值的原因。值类型的变量总是有预定义的值，比如说整型（int）的默认值是0，布尔（bool）类型的默认值是false。到目前为止一切尚好，但是当我们在真实世界中（不一定有使用所有的数据变量）应用严格的数学规则的时候，问题出现了。举个例子，用0如何区别用户没有钱和用户没有输入任何可以在软件中存储的数据呢？当你使用关系型数据库的时候这种情况会更加明显。关系型数据有空值（null value）的概念，用来表示没有数据，但是对于值类型来说，在.NET编程语言中并没有提供合适的值。<br><br><o:p></o:p></p>
<p align=left>使用当前的技术来解决Nullable值的问题<br><br><o:p></o:p></p>
<p align=left>多少年来开发人员采用了好多种方法来解决这个问题，这里将会简单提到其中的一些。<br><br><o:p></o:p></p>
<p align=left>使用特殊值<br><br><o:p></o:p></p>
<p align=left>其中一个最明显的解决方案就是使用一些特殊的不用的值来代替空值。比如你要处理年龄，你定义了整型并且用－1来代替空值。这种解决方法只有在确定这个值是肯定不会用到而且不会和其中真实值产生混淆的时候是可行的。再比如如果你用－1代表你的美元数量，那可能表示你将失去一块钱，所以这种情况下使用－1来代替是不合适的。这种解决方案很容易实现，但是一般来说是不赞成的因为会造成潜在的运行时难以发现的bug,尤其是应用程序的需求在后期变化的时候，前面被当做空值使用的值将变成合法的数据。<br><br><o:p></o:p></p>
<p align=left>使用标记<br><br><o:p></o:p></p>
<p align=left>我曾经经常用的一种方案是给包含空值的对象定义一个标记来区别是否是空值。顺便提一下系统的类也是使用这种方法的。SqlDataReader有个属性IsDbNull用来识别从数据库返回的记录是不是空。<o:p></o:p></p>
<p align=left>这里有个使用这种方法的例子。<o:p></o:p></p>
<p align=left>public class Person<o:p></o:p></p>
<p align=left>{<br>&nbsp;&nbsp; private string _fullName;<br>&nbsp;&nbsp; private int _age;<br>&nbsp;&nbsp; private bool _hasAge;<br>&nbsp;&nbsp; public string FullName<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; get{return _fullName;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set{_fullName = value;}<br>&nbsp;&nbsp; }<o:p></o:p></p>
<p align=left>&nbsp;&nbsp; public int Age<o:p></o:p></p>
<p align=left>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(!_hasAge)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb