<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>hiDotNet 博客苑</title><link>http://blog.hidotnet.com/MainFeed.aspx</link><description>.NET Blogs by hiDotNet.com</description><generator>1.9.0.27</generator><item><title>Live writer</title><link>http://blog.hidotnet.com/PrideRoCK/archive/2008/07/13/Live-writer.aspx</link><pubDate>Sun, 13 Jul 2008 12:12:54 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/PrideRoCK/archive/2008/07/13/Live-writer.aspx</guid><wfw:comment>http://blog.hidotnet.com/PrideRoCK/comments/15431.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/PrideRoCK/comments/commentRss/15431.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/PrideRoCK/archive/2008/07/13/Live-writer.aspx#comment</comments><slash:comments>7</slash:comments><trackback:ping>http://blog.hidotnet.com/PrideRoCK/services/trackbacks/15431.aspx</trackback:ping><source url="http://blog.hidotnet.com/PrideRoCK/rss.aspx">Live writer</source><description>&lt;p&gt;图文测试&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blog.hidotnet.com/images/blog_hidotnet_com/PrideRoCK/WindowsLiveWriter/Livewriter_3B4F/Green%20Sea%20Turtle_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="Green Sea Turtle" src="http://blog.hidotnet.com/images/blog_hidotnet_com/PrideRoCK/WindowsLiveWriter/Livewriter_3B4F/Green%20Sea%20Turtle_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/PrideRoCK/aggbug/15431.aspx" width="1" height="1" /&gt;</description><dc:creator>PrideRoCK</dc:creator></item><item><title>sdfsadfsdaf</title><link>http://blog.hidotnet.com/PrideRoCK/archive/2008/07/04/sdfsadfsdaf.aspx</link><pubDate>Fri, 04 Jul 2008 09:04:32 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/PrideRoCK/archive/2008/07/04/sdfsadfsdaf.aspx</guid><wfw:comment>http://blog.hidotnet.com/PrideRoCK/comments/15148.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/PrideRoCK/comments/commentRss/15148.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/PrideRoCK/archive/2008/07/04/sdfsadfsdaf.aspx#comment</comments><slash:comments>2</slash:comments><trackback:ping>http://blog.hidotnet.com/PrideRoCK/services/trackbacks/15148.aspx</trackback:ping><source url="http://blog.hidotnet.com/PrideRoCK/rss.aspx">sdfsadfsdaf</source><description>&lt;p&gt;asdfsdafdsf&lt;a href="http://blog.hidotnet.com/images/blog_hidotnet_com/PrideRoCK/WindowsLiveWriter/sdfsadfsdaf_EFEF/Green%20Sea%20Turtle_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="184" alt="Green Sea Turtle" src="http://blog.hidotnet.com/images/blog_hidotnet_com/PrideRoCK/WindowsLiveWriter/sdfsadfsdaf_EFEF/Green%20Sea%20Turtle_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/PrideRoCK/aggbug/15148.aspx" width="1" height="1" /&gt;</description><dc:creator>PrideRoCK</dc:creator></item><item><title>Can you sell yourself in two minutes</title><link>http://blog.hidotnet.com/Databinder/archive/2008/07/03/15130.aspx</link><pubDate>Thu, 03 Jul 2008 03:40:15 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2008/07/03/15130.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/15130.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/15130.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2008/07/03/15130.aspx#comment</comments><slash:comments>3</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/15130.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">Can you sell yourself in two minutes</source><description>&lt;p&gt;&lt;a href="http://blog.hidotnet.com/images/blog_hidotnet_com/databinder/WindowsLiveWriter/testbywlw_A3C0/Sunset_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" title="Sunset" border="0" alt="Sunset" src="http://blog.hidotnet.com/images/blog_hidotnet_com/databinder/WindowsLiveWriter/testbywlw_A3C0/Sunset_thumb.jpg" width="244" height="184" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Q： Can you sell yourself in two minutes？ Go for it.    &lt;br /&gt;    你能在两分钟內自我推荐吗？大胆试试吧！ &lt;/p&gt;  &lt;p&gt;A： With my qualifications and experience, I feel I am hardworking, responsible and diligent in any project I undertake. Your organization could benefit from my analytical and interpersonal skills.   &lt;br /&gt;    依我的资格和经验，我觉得我对所从事的每一个项目都很努力、负责、勤勉。我的分析能力和与人相处的技巧，对贵单位必有价值。 &lt;/p&gt;  &lt;p&gt;Q： Give me a summary of your current job description.    &lt;br /&gt;    对你目前的工作，能否做个概括的说明。 &lt;/p&gt;  &lt;p&gt;A： I have been working as a computer programmer for five years. To be specific, I do system analysis, trouble shooting and provide software support.    &lt;br /&gt;    我干了五年的电脑程序员。具体地说，我做系统分析，解决问题以及软件供应方面的支持。 &lt;/p&gt;  &lt;p&gt;Q： Why did you leave your last job？   &lt;br /&gt;    你为什么离职呢？ &lt;/p&gt;  &lt;p&gt;A： Well, I am hoping to get an offer of a better position. If opportunity knocks, I will take it.   &lt;br /&gt;    我希望能获得一份更好的工作，如果机会来临，我会抓住。 &lt;/p&gt;  &lt;p&gt;A： I feel I have reached the "glass ceiling" in my current job. I feel there is no opportunity for advancement.    &lt;br /&gt;    我觉得目前的工作，已经达到顶峰，即沒有升迁机会。 &lt;/p&gt;  &lt;p&gt;Q： How do you rate yourself as a professional？   &lt;br /&gt;    你如何评估自己是位专业人员呢？ &lt;/p&gt;  &lt;p&gt;A： With my strong academic background, I am capable and competent.    &lt;br /&gt;    凭借我良好的学术背景，我可以胜任自己的工作，而且我认为自己很有竞争力。 &lt;/p&gt;  &lt;p&gt;A： With my teaching experience, I am confident that I can relate to students very well.   &lt;br /&gt;    依我的教学经验，我相信能与学生相处的很好。 &lt;/p&gt;  &lt;p&gt;Q： What contribution did you make to your current (previous) organization？   &lt;br /&gt;    你对目前/从前的工作单位有何贡献？ &lt;/p&gt;  &lt;p&gt;A： I have finished three new projects, and I am sure I can apply my experience to this position.   &lt;br /&gt;    我已经完成三个新项目，我相信我能将我的经验用在这份工作上。 &lt;/p&gt;  &lt;p&gt;Q： What do you think you are worth to us？   &lt;br /&gt;    你怎么认为你对我们有价值呢？ &lt;/p&gt;  &lt;p&gt;A： I feel I can make some positive contributions to your company in the future.    &lt;br /&gt;    我觉得我对贵公司能做些积极性的贡献。 &lt;/p&gt;  &lt;p&gt;Q： What make you think you would be a success in this position？   &lt;br /&gt;    你如何知道你能胜任这份工作？ &lt;/p&gt;  &lt;p&gt;A： My graduate school training combined with my internship should qualify me for this particular job. I am sure I will be successful.    &lt;br /&gt;    我在研究所的训练，加上实习工作，使我适合这份工作。我相信我能成功。 &lt;/p&gt;  &lt;p&gt;Q： Are you a multi-tasked individual？Do you work well under stress or pressure？   &lt;br /&gt;    你是一位可以同时承担数项工作的人吗？你能承受工作上的压力吗？ &lt;/p&gt;  &lt;p&gt;A： Yes, I think so. &lt;/p&gt;  &lt;p&gt;A： The trait is needed in my current（or previous) position and I know I can handle it well.    &lt;br /&gt;    这种特点就是我目前（先前）工作所需要的，我知道我能应付自如。 &lt;/p&gt;  &lt;p&gt;Q： What is your strongest trait(s)？   &lt;br /&gt;    你个性上最大的特点是什么？ &lt;/p&gt;  &lt;p&gt;A： Helpfulness and caring.   &lt;br /&gt;    乐于助人和关心他人。 &lt;/p&gt;  &lt;p&gt;A： Adaptability and sense of humor.   &lt;br /&gt;    适应能力和幽默感。 &lt;/p&gt;  &lt;p&gt;A： Cheerfulness and friendliness.   &lt;br /&gt;    乐观和友爱。 &lt;/p&gt;  &lt;p&gt;Q： How would your friends or colleagues describe you？   &lt;br /&gt;    你的朋友或同事怎样形容你？ &lt;/p&gt;  &lt;p&gt;A： (pause a few seconds)    &lt;br /&gt;    （稍等几秒钟再答，表示慎重考虑。) &lt;/p&gt;  &lt;p&gt;    They say Mr. Chen is an honest, hardworking and responsible man who deeply cares for his family and friends.    &lt;br /&gt;    他们说陈先生是位诚实、工作努力，负责任的人，他对家庭和朋友都很关心。 &lt;/p&gt;  &lt;p&gt;A： They say Mr. Chen is a friendly, sensitive, caring and determined person.    &lt;br /&gt;    他们说陈先生是位很友好、敏感、关心他人和有决心的人。 &lt;/p&gt;  &lt;p&gt;Q： What personality traits do you admire？   &lt;br /&gt;    你欣赏哪种性格的人？) &lt;/p&gt;  &lt;p&gt;A： I admire a person who is）honest, flexible and easy-going.    &lt;br /&gt;    诚实、不死板而且容易相处的人。 &lt;/p&gt;  &lt;p&gt;A： (I like) people who possess the "can do" spirit.    &lt;br /&gt;    有"实际行动"的人。 &lt;/p&gt;  &lt;p&gt;Q： What leadership qualities did you develop as an administrative personnel？   &lt;br /&gt;    作为行政人员，你有什么样的领导才能？ &lt;/p&gt;  &lt;p&gt;A： I feel that learning how to motivate people and to work together as a team will be the major goal of my leadership.    &lt;br /&gt;    我觉得学习如何把人们的积极性调动起来，以及如何配合协同的团队精神，是我行政工作的主要目标。 &lt;/p&gt;  &lt;p&gt;A： I have refined my management style by using an open-door policy.    &lt;br /&gt;    我以开放式的政策，改进我的行政管理方式。 &lt;/p&gt;  &lt;p&gt;Q： How do you normally handle criticism？   &lt;br /&gt;    你通常如何处理別人的批评？ &lt;/p&gt;  &lt;p&gt;A： Silence is golden. Just don't say anything; otherwise the situation could become worse. I do, however, accept constructive criticism.    &lt;br /&gt;    沉默是金。不必说什么，否则情况更糟，不过我会接受建设性的批评。 &lt;/p&gt;  &lt;p&gt;A： When we cool off, we will discuss it later.    &lt;br /&gt;    我会等大家冷靜下来再讨论。 &lt;/p&gt;  &lt;p&gt;Q： What do you find frustrating in a work situation？   &lt;br /&gt;    在工作中，什么事令你不高兴？ &lt;/p&gt;  &lt;p&gt;A： Sometimes, the narrow-minded people make me frustrated.   &lt;br /&gt;    胸襟狭窄的人，有时使我泄气。 &lt;/p&gt;  &lt;p&gt;A： Minds that are not receptive to new ideas.   &lt;br /&gt;    不能接受新思想的那些取。 &lt;/p&gt;  &lt;p&gt;Q： How do you handle your conflict with your colleagues in your work?    &lt;br /&gt;    你如何处理与同事在工作中的意见不和？ &lt;/p&gt;  &lt;p&gt;A： I will try to present my ideas in a more clear and civilized manner in order to get my points across.   &lt;br /&gt;    我要以更清楚文明的方式，提出我的看法，使对方了解我的观点。 &lt;/p&gt;  &lt;p&gt;Q： How do you handle your failure？   &lt;br /&gt;    你怎样对待自己的失敗？ &lt;/p&gt;  &lt;p&gt;A： None of us was born "perfect". I am sure I will be given    &lt;br /&gt;a second chance to correct my mistake.    &lt;br /&gt;    我们大家生来都不是十全十美的，我相信我有第二个机会改正我的错误。 &lt;/p&gt;  &lt;p&gt;Q： What provide you with a sense of accomplishment.   &lt;br /&gt;    什么会让你有成就感？ &lt;/p&gt;  &lt;p&gt;A： Doing my best job for your company.   &lt;br /&gt;    为贵公司竭力效劳。 &lt;/p&gt;  &lt;p&gt;A： Finishing a project to the best of my ability.   &lt;br /&gt;    尽我所能，完成一个项目。 &lt;/p&gt;  &lt;p&gt;Q： If you had a lot of money to donate, where would you donate it to？Why？   &lt;br /&gt;    假如你有很多钱可以捐赠，你会捐给什么单位？为什么？ &lt;/p&gt;  &lt;p&gt;A： I would donate it to the medical research because I want to do something to help others.    &lt;br /&gt;    我会捐给医药研究，因为我要为他人做点事。 &lt;/p&gt;  &lt;p&gt;A： I prefer to donate it to educational institutions.   &lt;br /&gt;    我乐意捐给教育机构。 &lt;/p&gt;  &lt;p&gt;Q： What is most important in your life right now？   &lt;br /&gt;    眼下你生活中最重要的是什么？ &lt;/p&gt;  &lt;p&gt;A： To get a job in my field is most important to me.   &lt;br /&gt;    对我来说，能在这个领域找到工作是最重要的。 &lt;/p&gt;  &lt;p&gt;A： To secure employment hopefully with your company.   &lt;br /&gt;    希望能在贵公司任职对我来说最重要。 &lt;/p&gt;  &lt;p&gt;Q： What current issues concern you the most？   &lt;br /&gt;    目前什么事是你最关心的？ &lt;/p&gt;  &lt;p&gt;A： The general state of our economy and the impact of China' entry to WTO on our industry.   &lt;br /&gt;    目前中国经济的总体情況以及中国入世对我们行业的影响。 &lt;/p&gt;  &lt;p&gt;Q： How long would you like to stay with this company？   &lt;br /&gt;    你会在本公司服务多久呢？ &lt;/p&gt;  &lt;p&gt;A： I will stay as long as I can continue to learn and to grow in my field.    &lt;br /&gt;    只要我能在我的行业力继续学习和长进，我就会留在这里。 &lt;/p&gt;  &lt;p&gt;Q： Could you project what you would like to be doing five years from now？   &lt;br /&gt;    你能预料五年后你会做什么吗？ &lt;/p&gt;  &lt;p&gt;A： As I have some administrative experience in my last job, I may use my organizational and planning skills in the future.    &lt;br /&gt;    我在上一个工作中积累了一些行政经验，我将来也许要运用我组织和计划上的经验和技巧。 &lt;/p&gt;  &lt;p&gt;A： I hope to demonstrate my ability and talents in my field adequately.    &lt;br /&gt;    我希望能充分展示我在这个行业的能力和智慧。 &lt;/p&gt;  &lt;p&gt;A： Perhaps, an opportunity at a management position would be exciting.   &lt;br /&gt;    也许有机会，我将会从事管理工作。 &lt;/p&gt;  &lt;p&gt;    （如果不愿正面回答，也可以说：）    &lt;br /&gt;    It would be premature for me to predict this.    &lt;br /&gt;    现在对此问题的预测，尚嫌过早。 &lt;/p&gt;  &lt;p&gt;    （甚至还可以打趣的说：）    &lt;br /&gt;    Hypothetically speaking, I might be able to do your current job as a director.    &lt;br /&gt;    （或 CEO 或 president）说不定，我也能做你现在主任的工作呢！ &lt;/p&gt;  &lt;p&gt;Q： What range of pay-scale are you interested in？   &lt;br /&gt;    你喜欢那一种薪水层次标准？ &lt;/p&gt;  &lt;p&gt;A： Money is important, but the responsibility that goes along with this job is what interests me the most.    &lt;br /&gt;    薪水固然重要，但这工作伴随而来的责任更吸引我。 &lt;/p&gt;  &lt;p&gt;A： （假如你有家眷，可以说：）   &lt;br /&gt;    To be frank and open with you, I like this job, but I have a family to support.     &lt;br /&gt;    坦白地说，我喜欢这份工作，不过我必须要负担我的家庭。 &lt;/p&gt;  &lt;p&gt;Other Tips  其它建议 &lt;/p&gt;  &lt;p&gt;Know something about the organization you are applying to.   &lt;br /&gt;了解一些你申请工作单位的情况。 &lt;/p&gt;  &lt;p&gt;Dress properly. Don't shake hand with the interviewer until he/she extends his/her hand.   &lt;br /&gt;穿着要得体，人家伸手时才握手。 &lt;/p&gt;  &lt;p&gt;Don't sit down until invited to do so by the interviewer.    &lt;br /&gt;人家未请，先別坐下。 &lt;/p&gt;  &lt;p&gt;Make eye-contact with the interviewer during the interview.   &lt;br /&gt;面试时，眼睛要看着对方。 &lt;/p&gt;  &lt;p&gt;Listen actively and stay calm.   &lt;br /&gt;注意听，保持冷静。 &lt;/p&gt;  &lt;p&gt;If invited to a meal, be especially careful about your table manners.   &lt;br /&gt;被邀吃饭时，要特別注意餐桌礼节。 &lt;/p&gt;  &lt;p&gt;Don't talk with your mouth full.   &lt;br /&gt;嘴里有食物，不可开口说话。 &lt;/p&gt;  &lt;p&gt;Don't make much noise while you eat.   &lt;br /&gt;吃东西不要出声音。 &lt;/p&gt;  &lt;p&gt;Don't blow your nose or use the toothpick at table.   &lt;br /&gt;不要拧鼻涕或用牙签剔牙。 &lt;/p&gt;  &lt;p&gt;Don't appear to be pushy or overly anxious to get a job.   &lt;br /&gt;不必过分表现急着要工作。 &lt;/p&gt;  &lt;p&gt;Be honest but not too modest.   &lt;br /&gt;要诚实，但不必太谦虚。 &lt;/p&gt;  &lt;p&gt;Don't put yourself down or cut yourself up.   &lt;br /&gt;不可妄自菲薄或自贬。 &lt;/p&gt;  &lt;p&gt;Try to avoid discussing politics or religion with your interviewer.   &lt;br /&gt;避免与面试人谈政治或宗教。 &lt;/p&gt;&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/15130.aspx" width="1" height="1" /&gt;</description><dc:creator>Databinder</dc:creator></item><item><title>URL重写</title><link>http://blog.hidotnet.com/Databinder/archive/2008/05/13/13498.aspx</link><pubDate>Tue, 13 May 2008 07:31:40 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2008/05/13/13498.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/13498.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/13498.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2008/05/13/13498.aspx#comment</comments><slash:comments>1</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/13498.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">URL重写</source><description>重写是截取传入 Web 请求并自动将请求重定向到其他 URL 的过程。&lt;br /&gt;
   比如浏览器发来请求hostname/101.aspx ，服务器自动将这个请求中定向为http://hostname/list.aspx?id=101。&lt;br /&gt;
&lt;br /&gt;
url重写的优点在于：&lt;br /&gt;
     缩短url，隐藏实际路径提高安全性&lt;br /&gt;
     易于用户记忆和键入。 &lt;br /&gt;
     易于被搜索引擎收录&lt;br /&gt;
&lt;br /&gt;
二 实现url重写的基本方法&lt;br /&gt;
    下载MS的URLRewriter.dll，放到你的web程序的bin下&lt;br /&gt;
下载地址1：http://www.rickel.cn/uploads/DevTools/MSDNURLRewriting.msi&lt;br /&gt;
下载地址2：download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi&lt;br /&gt;
&lt;br /&gt;
下载完成后，在web.config里设置如下：&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;br /&gt;
&amp;lt;!--overred--&amp;gt;&lt;br /&gt;
&amp;lt;configuration&amp;gt;&lt;br /&gt;
     &amp;lt;configSections&amp;gt;&lt;br /&gt;
         &amp;lt;section name="RewriterConfig"type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" /&amp;gt;&lt;br /&gt;
     &amp;lt;/configSections&amp;gt;&lt;br /&gt;
     &amp;lt;RewriterConfig&amp;gt;&lt;br /&gt;
         &amp;lt;Rules&amp;gt;&lt;br /&gt;
             &amp;lt;RewriterRule&amp;gt;&lt;br /&gt;
                 &amp;lt;LookFor&amp;gt;~/d(\d+)\.aspx&amp;lt;/LookFor&amp;gt;&lt;br /&gt;
                 &amp;lt;SendTo&amp;gt;~/default.aspx?id=$1&amp;lt;/SendTo&amp;gt;&lt;br /&gt;
             &amp;lt;/RewriterRule&amp;gt;&lt;br /&gt;
         &amp;lt;/Rules&amp;gt;&lt;br /&gt;
     &amp;lt;/RewriterConfig&amp;gt;&lt;br /&gt;
     &amp;lt;system.web&amp;gt;&lt;br /&gt;
         &amp;lt;httpHandlers&amp;gt;&lt;br /&gt;
             &amp;lt;add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" /&amp;gt;&lt;br /&gt;
         &amp;lt;/httpHandlers&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
其中&lt;br /&gt;
&amp;lt;section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
用于指定配置节"RewriterConfig"的处理程序类的名称为”URLRewriter.Config.RewriterConfigSerializerSectionHandler”，该类存在于bin目录下的URLRewriter .dll文件中&lt;br /&gt;
&lt;br /&gt;
关键的是这两句&lt;br /&gt;
&amp;lt;LookFor&amp;gt;~/d(\d+)\.aspx&amp;lt;/LookFor&amp;gt;&lt;br /&gt;
&amp;lt;SendTo&amp;gt;~/default.aspx?id=$1&amp;lt;/SendTo&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;LookFor&amp;gt;~/d(\d+)\.aspx&amp;lt;/LookFor&amp;gt;表示，用户输入的url，d(\d+)\.aspx是 url中文件名匹配的正则表达式（此处为字母d开头，后面跟一个或多个数字，并以.aspx结尾。用户也可根据自己的需要自行设定）。&lt;br /&gt;
&amp;lt;SendTo&amp;gt;~/default.aspx?id=$1&amp;lt;/SendTo&amp;gt;，表示当服务器接收到符合上面条件的请求后如何重写url。此处表示访问defalutl.aspx并传入参数id,其值$1将用用户请求的文件名中的第一个数字来表示。&lt;br /&gt;
例如用户输入 hostname/d11.aspx，服务器会把他重写为http://hostname/default.aspx?id=11。换句话说用户输入http: //hostname/d11.aspx，实际访问的是http://hostname/default.aspx?id=11。这样就起到了隐藏真实文件名，并便于用户记忆的作用。&lt;br /&gt;
&lt;br /&gt;
处理回发&lt;br /&gt;
在重写后的url里如果产生回发，例如有一个按钮，又调用了该被重写的aspx，用户浏览器中将会显示该aspx文件实际的地址，也就是http: //hostname/default.aspx?id=11。但从用户的角度考虑，如 果单击按钮时突然看到 URL 更改会使他们感到不安。因此必须解决这个问题。&lt;br /&gt;
解决方法有二：&lt;br /&gt;
（1）自己定义一个Actionlessform类，在aspx中不再使用系统提供的form 标记&lt;br /&gt;
&lt;br /&gt;
namespace ActionlessForm &lt;br /&gt;
{&lt;br /&gt;
     public class Form : System.Web.UI.HtmlControls.HtmlForm&lt;br /&gt;
     {&lt;br /&gt;
        protected override void RenderAttributes(HtmlTextWriter writer)&lt;br /&gt;
         {&lt;br /&gt;
             writer.WriteAttribute("name", this.Name);&lt;br /&gt;
             base.Attributes.Remove("name");&lt;br /&gt;
             writer.WriteAttribute("method", this.Method);&lt;br /&gt;
             base.Attributes.Remove("method");&lt;br /&gt;
             this.Attributes.Render(writer);&lt;br /&gt;
             base.Attributes.Remove("action");&lt;br /&gt;
             if (base.ID != null)&lt;br /&gt;
                 writer.WriteAttribute("id", base.ClientID);&lt;br /&gt;
          }&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
创建此类并对其进行编译之后，要在 ASP.NET Web 应用程序中使用它，应首先将其添加到 Web 应用程序的 References 文件夹中。然后，要使用它来代替 HtmlForm 类，做法是在 ASP.NET 网页的顶部添加以下内容：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ Register TagPrefix="skm" Namespace="ActionlessForm" Assembly="ActionlessForm" %&amp;gt;&lt;br /&gt;
然后，将 &amp;lt;form runat="server"&amp;gt;（如果有）替换为：&amp;lt;skm:Form id="Form1" method="post" runat="server"&amp;gt; &lt;br /&gt;
并将右边的 &amp;lt;/form&amp;gt; 标记替换为：&amp;lt;/skm:Form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
个人并不推荐该方法&lt;br /&gt;
（2）第二种方法就是继承page，这样你不需要在aspx页中改任何东西。&lt;br /&gt;
代码：&lt;br /&gt;
using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Web.UI;&lt;br /&gt;
namespace URL&lt;br /&gt;
{&lt;br /&gt;
     public class OLPage : Page&lt;br /&gt;
     {&lt;br /&gt;
         public OLPage()&lt;br /&gt;
         {}&lt;br /&gt;
         protected override void Render(HtmlTextWriter writer)&lt;br /&gt;
         {&lt;br /&gt;
             if (writer is System.Web.UI.Html32TextWriter)&lt;br /&gt;
             {&lt;br /&gt;
                 writer = new FormFixerHtml32TextWriter(writer.InnerWriter);&lt;br /&gt;
             }&lt;br /&gt;
             else&lt;br /&gt;
             {&lt;br /&gt;
                 writer = new FormFixerHtmlTextWriter(writer.InnerWriter);&lt;br /&gt;
             }&lt;br /&gt;
             base.Render(writer);&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     internal class FormFixerHtml32TextWriter : System.Web.UI.Html32TextWriter&lt;br /&gt;
     {&lt;br /&gt;
         private string _url; // 假的URL&lt;br /&gt;
&lt;br /&gt;
     internal FormFixerHtml32TextWriter(TextWriter writer):base(writer)&lt;br /&gt;
     {&lt;br /&gt;
         _url = HttpContext.Current.Request.RawUrl;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     public override void WriteAttribute(string name, string value, bool encode)&lt;br /&gt;
     {&lt;br /&gt;
         if (_url != null &amp;amp;&amp;amp; string.Compare(name, "action", true) == 0)&lt;br /&gt;
         {&lt;br /&gt;
             value = _url;&lt;br /&gt;
         }&lt;br /&gt;
         base.WriteAttribute(name, value, encode);&lt;br /&gt;
&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
internal class FormFixerHtmlTextWriter : System.Web.UI.HtmlTextWriter&lt;br /&gt;
{&lt;br /&gt;
     private string _url;&lt;br /&gt;
     internal FormFixerHtmlTextWriter(TextWriter writer):base(writer)&lt;br /&gt;
     {&lt;br /&gt;
         _url = HttpContext.Current.Request.RawUrl;&lt;br /&gt;
     }&lt;br /&gt;
    &lt;br /&gt;
     public override void WriteAttribute(string name, string value, bool encode)&lt;br /&gt;
     {&lt;br /&gt;
         if (_url != null &amp;amp;&amp;amp; string.Compare(name, "action", true) == 0)&lt;br /&gt;
         {&lt;br /&gt;
             value = _url;&lt;br /&gt;
         }&lt;br /&gt;
         base.WriteAttribute(name, value, encode);&lt;br /&gt;
     }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
把这个文件编译成dll，并在你的项目中引用它。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
然后把项目中的所有aspx文件对应的cs文件中的继承page类的代码改写为继承OLPage。&lt;br /&gt;
例如&lt;br /&gt;
public class WebForm1:page&lt;br /&gt;
改写为&lt;br /&gt;
public class WebForm1:URL.OLPage&lt;br /&gt;
&lt;br /&gt;
这样就解决回发问题。&lt;br /&gt;
编译*.dll方法：/t:library name.cs&lt;br /&gt;&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/13498.aspx" width="1" height="1" /&gt;</description><dc:creator>Databinder</dc:creator></item><item><title>常用IL指令</title><link>http://blog.hidotnet.com/flashccie/archive/2007/11/08/2836.aspx</link><pubDate>Wed, 07 Nov 2007 17:51:38 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/flashccie/archive/2007/11/08/2836.aspx</guid><wfw:comment>http://blog.hidotnet.com/flashccie/comments/2836.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/flashccie/comments/commentRss/2836.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/flashccie/archive/2007/11/08/2836.aspx#comment</comments><slash:comments>1</slash:comments><trackback:ping>http://blog.hidotnet.com/flashccie/services/trackbacks/2836.aspx</trackback:ping><source url="http://blog.hidotnet.com/flashccie/rss.aspx">常用IL指令</source><description>&lt;p&gt;为了今后分析IL代码。先把一个最最常用的指的功能列出来一下：&lt;/p&gt;
&lt;strong&gt;
&lt;h3&gt;&lt;strong&gt;ldstr &lt;/strong&gt;&lt;/h3&gt;
&lt;/strong&gt;
&lt;p&gt;功能：将对字符串的对象引用推送到堆栈上，ldstr 指令推送对表示&lt;font color="#ff0000"&gt;在元数据中存储&lt;/font&gt;的&lt;font color="#ff0022"&gt;特定字符串&lt;/font&gt;的&lt;font color="#ff0044"&gt;新字符串对象&lt;/font&gt;的&lt;font color="#ff0066"&gt;对象引用&lt;/font&gt;（O 类型）。ldstr 指令分配必需的内存量并执行将字符串从在文件中使用的形式转换为在运行时要求的字符串格式所需的任何格式转换。&lt;/p&gt;
&lt;p&gt;搞个示例:Console.WriteLine("Hi Flashccie");&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;ldstr "Hi Flashccie"&lt;br /&gt;
call void [mscorlib]System.Console::WriteLine(string)&lt;br /&gt;
ret&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;strong&gt;
&lt;h3&gt;
&lt;p&gt;&lt;strong&gt;ldc.i4 &lt;span class="parameter"&gt;num,,,,idc.i4.0,,,,idc.i4.1................&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/h3&gt;
&lt;/strong&gt;
&lt;p&gt;功能：将值 &lt;span class="parameter"&gt;num&lt;/span&gt; 推送到堆栈上,对于整数 -128 到 127 有特殊的简短编码（并因此更有效），对于整数 -1 到 8 尤其有特殊的简短编码。所有简短编码都将 4 字节整数推送到堆栈上。如：ldc.i4.0 ,ldc.i4.1,.....等&lt;/p&gt;
&lt;p&gt;较长的编码用于 8 字节整数以及 4 和 8 字节浮点数，并且用于不适合短格式的 4 字节值。有三种方法可以将 8 字节整数常数推送到堆栈上 &lt;/p&gt;
&lt;p&gt;1. 使用 &lt;strong&gt;ldc.i8&lt;/strong&gt;指令用于必须以超过 32 位表示的常数。&lt;/p&gt;
&lt;p&gt;2. 使用 idc.i4 指令（后跟 conv.i8）用于需要 9 到 32 位的常数。&lt;/p&gt;
&lt;p&gt;3. 使用短格式指令（后跟 conv.i8）用于可以 8 位或更少位表示的常数。&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;strong&gt;
&lt;h3&gt;
&lt;p&gt;&lt;strong&gt;stloc &lt;span class="parameter"&gt;index&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/h3&gt;
&lt;/strong&gt;
&lt;p&gt;功能:从堆栈中弹出值并将其放在局部变量 &lt;span class="parameter"&gt;index&lt;/span&gt; 中。(index最大：65534，从0开始)&lt;/p&gt;
&lt;p&gt;stloc 指令从计算堆栈中弹出位于顶部的值并将其移动到局部变量号 &lt;span class="parameter"&gt;index&lt;/span&gt; 中，其中局部变量从 0 向上进行编号。值的类型必须与当前方法的本地签名所指定的局部变量的类型匹配。&lt;/p&gt;
&lt;p&gt;在将值保存到只能容纳长度小于 4 个字节的整数值的局部变量中时，会在将该值从堆栈移动到局部变量中时将其截断。将浮点值从其本机大小（F 类型）舍入到与该参数关联的大小。&lt;/p&gt;
&lt;p&gt;怎么理解呢？&lt;/p&gt;
&lt;p&gt;比如你在一个方法中定义下以下几个变量：&lt;/p&gt;
&lt;p&gt;int i;&lt;br /&gt;
int i0=new Int();&lt;br /&gt;
哪么就会生成以下IL代码：&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;    .locals init (&lt;br /&gt;
        [0] int32 num,&lt;br /&gt;
        [1] int32 num2)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;L_0000: nop &lt;br /&gt;
    &lt;br /&gt;
//初始化i0为0&lt;br /&gt;
L_0001: ldc.i4.0 //将0推上栈顶&lt;br /&gt;
L_0002: stloc.1 //从堆栈顶部弹出一个值到索引号为1的变量中去&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;未完....基本的指令，最少也要求能把简单的一个程序搞完才行。不过，指令相对也不会很多。很晚了。睡去了。。&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/flashccie/aggbug/2836.aspx" width="1" height="1" /&gt;</description><dc:creator>轻舞flash</dc:creator></item><item><title>自己重新重写Equals</title><link>http://blog.hidotnet.com/Databinder/archive/2007/07/03/564.aspx</link><pubDate>Tue, 03 Jul 2007 14:14:56 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2007/07/03/564.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/564.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/564.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2007/07/03/564.aspx#comment</comments><slash:comments>54</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/564.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">自己重新重写Equals</source><description>&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;今天在项目中我自己写了个集合类，由于要存储非常多的数据，所以我想把集合类下载到用户本地，然后在本地再取对象，这样就减少了频繁读取数据库的次数，可是在用到ArrayList的contains的时候，我的对象明明在集合里存在，但是还是返回False ,后来想到ArrayList是引用类型，在每一次实例化的时候对象的内存地址都不一样，本来想遍历集合，但考虑到效率不高，在网上找到可以重写Equals方法,在C#的容器中,常用的三个容器数组,ArrayList, Hashtable..数组比较简单,实现某种单一数据的存储,但是并不能自由插入,移除和容纳不同的对象..,所以ArrayList是数组的替代品, 并且由于ArrayList可以自由的添加,删除,插入,读取,给我们提供了足够大&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;的自由性,颇得我的青睐..不过使用中,难免有些缺点,感觉最麻烦的就是检测某对象是否在Items中..因为每&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;一个new出来的Class在内存中的表现不相同,即便是同一个类,你new出来两个,然后再判断,也是会一样的!!所以每次使用ArrayList.Contains()检测对象的时候,难免都得不到自&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;己想要的结果..因为每个Class都是继承自Object类..而ArrayList.Contains()的实现是IList.Contains,而此方法是调用Class中的Equals方法&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;判断是否相等,这个时候,可以在自己的对象中覆写Object.Equals方法,以达到自己的目的..&lt;span style="color: red;"&gt;注意&lt;/span&gt;,如果你覆写了&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;Equals方法,则也要覆写GetHashCode(),因为Equals是用获取Object.GetHashCode()来做判断的.看看下面的代&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;码就明白:&lt;/span&gt;&lt;/p&gt;
&lt;div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 1&lt;/span&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; System;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 3&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;namespace&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; HashCode_Test&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 4&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_39_928_Open_Text.style.display='none'; Codehighlighter1_39_928_Closed_Image.style.display='inline'; Codehighlighter1_39_928_Closed_Text.style.display='inline';" id="Codehighlighter1_39_928_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" onclick="this.style.display='none'; Codehighlighter1_39_928_Closed_Text.style.display='none'; Codehighlighter1_39_928_Open_Image.style.display='inline'; Codehighlighter1_39_928_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_39_928_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_39_928_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_39_928_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 5&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_41_91_Open_Text.style.display='none'; Codehighlighter1_41_91_Closed_Image.style.display='inline'; Codehighlighter1_41_91_Closed_Text.style.display='inline';" id="Codehighlighter1_41_91_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_41_91_Closed_Text.style.display='none'; Codehighlighter1_41_91_Open_Image.style.display='inline'; Codehighlighter1_41_91_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_41_91_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_41_91_Closed_Text"&gt;/**/&lt;/span&gt;&lt;span id="Codehighlighter1_41_91_Open_Text"&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 6&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;        给你的类加入Equals,测试类&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 7&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(0, 128, 128);"&gt; 8&lt;/span&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 9&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_112_926_Open_Text.style.display='none'; Codehighlighter1_112_926_Closed_Image.style.display='inline'; Codehighlighter1_112_926_Closed_Text.style.display='inline';" id="Codehighlighter1_112_926_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_112_926_Closed_Text.style.display='none'; Codehighlighter1_112_926_Open_Image.style.display='inline'; Codehighlighter1_112_926_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_112_926_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_112_926_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_112_926_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;10&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; myHashCode &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;11&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2( &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; id )    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;传递进一个int,作为GetHashCode的值&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;12&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_188_210_Open_Text.style.display='none'; Codehighlighter1_188_210_Closed_Image.style.display='inline'; Codehighlighter1_188_210_Closed_Text.style.display='inline';" id="Codehighlighter1_188_210_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_188_210_Closed_Text.style.display='none'; Codehighlighter1_188_210_Open_Image.style.display='inline'; Codehighlighter1_188_210_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_188_210_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_188_210_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_188_210_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;13&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        myHashCode &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; id;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;14&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;15&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;16&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;覆写GetHashCode,关键的一步&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;17&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; GetHashCode()    &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;18&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_275_299_Open_Text.style.display='none'; Codehighlighter1_275_299_Closed_Image.style.display='inline'; Codehighlighter1_275_299_Closed_Text.style.display='inline';" id="Codehighlighter1_275_299_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_275_299_Closed_Text.style.display='none'; Codehighlighter1_275_299_Open_Image.style.display='inline'; Codehighlighter1_275_299_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_275_299_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_275_299_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_275_299_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;19&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; myHashCode;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;20&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;21&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;22&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;这步,可有可无,主要是做测试结果用的&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;23&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ToString()    &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;24&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_363_400_Open_Text.style.display='none'; Codehighlighter1_363_400_Closed_Image.style.display='inline'; Codehighlighter1_363_400_Closed_Text.style.display='inline';" id="Codehighlighter1_363_400_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_363_400_Closed_Text.style.display='none'; Codehighlighter1_363_400_Open_Image.style.display='inline'; Codehighlighter1_363_400_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_363_400_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_363_400_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_363_400_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;25&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; DateTime.Now.ToString();&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;26&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;27&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;28&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_406_544_Open_Text.style.display='none'; Codehighlighter1_406_544_Closed_Image.style.display='inline'; Codehighlighter1_406_544_Closed_Text.style.display='inline';" id="Codehighlighter1_406_544_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_406_544_Closed_Text.style.display='none'; Codehighlighter1_406_544_Open_Image.style.display='inline'; Codehighlighter1_406_544_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_406_544_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_406_544_Closed_Text"&gt;/**/&lt;/span&gt;&lt;span id="Codehighlighter1_406_544_Open_Text"&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;29&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;        重载了Equals方法,这步和GetHashCode配合起来才会有效果&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;30&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;31&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;param name="o"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;要检测的对象&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;32&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;返回是否相同&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(0, 128, 128);"&gt;33&lt;/span&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Equals( &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; o )    &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;34&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_588_631_Open_Text.style.display='none'; Codehighlighter1_588_631_Closed_Image.style.display='inline'; Codehighlighter1_588_631_Closed_Text.style.display='inline';" id="Codehighlighter1_588_631_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_588_631_Closed_Text.style.display='none'; Codehighlighter1_588_631_Open_Image.style.display='inline'; Codehighlighter1_588_631_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_588_631_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_588_631_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_588_631_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;35&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; o.GetHashCode() &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; myHashCode;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;36&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;37&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;38&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;在这里使用运算符重载,主要是为了进一步演示Equals&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;39&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;operator&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; c1, Class2 c2) &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;40&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_721_778_Open_Text.style.display='none'; Codehighlighter1_721_778_Closed_Image.style.display='inline'; Codehighlighter1_721_778_Closed_Text.style.display='inline';" id="Codehighlighter1_721_778_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_721_778_Closed_Text.style.display='none'; Codehighlighter1_721_778_Open_Image.style.display='inline'; Codehighlighter1_721_778_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_721_778_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_721_778_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_721_778_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;41&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; c1.GetHashCode().Equals( c2.GetHashCode() );&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;42&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;43&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;44&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;当你重载了==运算符后,必须要重载!=运算符&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;45&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;operator&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;!=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; c1, Class2 c2) &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;46&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_864_921_Open_Text.style.display='none'; Codehighlighter1_864_921_Closed_Image.style.display='inline'; Codehighlighter1_864_921_Closed_Text.style.display='inline';" id="Codehighlighter1_864_921_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_864_921_Closed_Text.style.display='none'; Codehighlighter1_864_921_Open_Image.style.display='inline'; Codehighlighter1_864_921_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_864_921_Closed_Image" alt="" /&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_864_921_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_864_921_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;47&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; c1.GetHashCode().Equals( c2.GetHashCode() );&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;48&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;49&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;50&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;51&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style="color: red;"&gt;&lt;strong&gt;这里是测试代码:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 1&lt;/span&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Collections.ArrayList arr &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; System.Collections.ArrayList();&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 3&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 4&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_111_177_Open_Text.style.display='none'; Codehighlighter1_111_177_Closed_Image.style.display='inline'; Codehighlighter1_111_177_Closed_Text.style.display='inline';" id="Codehighlighter1_111_177_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" onclick="this.style.display='none'; Codehighlighter1_111_177_Closed_Text.style.display='none'; Codehighlighter1_111_177_Open_Image.style.display='inline'; Codehighlighter1_111_177_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_111_177_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ( i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;; i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;4&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ; i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;++&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ) &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_111_177_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_111_177_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 5&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    Class2 class2 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2(i);        &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;我们添加四个对象&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 6&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    arr.Add( class2 );&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 7&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 8&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt; 9&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ( i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;; i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;4&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ; i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;++&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ) &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;10&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_209_332_Open_Text.style.display='none'; Codehighlighter1_209_332_Closed_Image.style.display='inline'; Codehighlighter1_209_332_Closed_Text.style.display='inline';" id="Codehighlighter1_209_332_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" onclick="this.style.display='none'; Codehighlighter1_209_332_Closed_Text.style.display='none'; Codehighlighter1_209_332_Open_Image.style.display='inline'; Codehighlighter1_209_332_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_209_332_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_209_332_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_209_332_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;11&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    Class2 class2 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2(i);        &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;重新创建四个对象,判断是否和容器中的对象相等&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;12&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    Console.WriteLine( i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; arr.Contains(class2));&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;全部输出true&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;13&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;14&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;15&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;16&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;17&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;Class2 class2_1 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;再创建对象1,并添加到容器中,以判断是否有多个对象1存在&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;18&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;arr.Add( class2_1  );                &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;19&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;20&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_516_872_Open_Text.style.display='none'; Codehighlighter1_516_872_Closed_Image.style.display='inline'; Codehighlighter1_516_872_Closed_Text.style.display='inline';" id="Codehighlighter1_516_872_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" onclick="this.style.display='none'; Codehighlighter1_516_872_Closed_Text.style.display='none'; Codehighlighter1_516_872_Open_Image.style.display='inline'; Codehighlighter1_516_872_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_516_872_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;for&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ( i &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;i&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;arr.Count;i&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;++&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  ) &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_516_872_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_516_872_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;21&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    Class2 class2_3 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Class2(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;这个时候我们要检测出容器中有多少个对象1&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;22&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_608_670_Open_Text.style.display='none'; Codehighlighter1_608_670_Closed_Image.style.display='inline'; Codehighlighter1_608_670_Closed_Text.style.display='inline';" id="Codehighlighter1_608_670_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_608_670_Closed_Text.style.display='none'; Codehighlighter1_608_670_Open_Image.style.display='inline'; Codehighlighter1_608_670_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_608_670_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ( arr[i].Equals( class2_3 ) ) &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_608_670_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_608_670_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;我们用Equals来检测是否相等&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;23&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        Console.WriteLine( &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;我用Equals找到\t&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  );&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;24&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;25&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ( arr[i] &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;==&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; class2_3  )            &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;我们用==来检测相等&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;26&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" onclick="this.style.display='none'; Codehighlighter1_716_756_Open_Text.style.display='none'; Codehighlighter1_716_756_Closed_Image.style.display='inline'; Codehighlighter1_716_756_Closed_Text.style.display='inline';" id="Codehighlighter1_716_756_Open_Image" alt="" /&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif" onclick="this.style.display='none'; Codehighlighter1_716_756_Closed_Text.style.display='none'; Codehighlighter1_716_756_Open_Image.style.display='inline'; Codehighlighter1_716_756_Open_Text.style.display='inline';" style="display: none;" id="Codehighlighter1_716_756_Closed_Image" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);" id="Codehighlighter1_716_756_Closed_Text"&gt;&lt;img src="http://www.cnblogs.com/Images/dot.gif" alt="" /&gt;&lt;/span&gt;&lt;span id="Codehighlighter1_716_756_Open_Text"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;27&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;        Console.WriteLine( &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;我用==找到\t&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  );&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;28&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" alt="" /&gt;    }&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;29&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;    Console.WriteLine( arr[i].ToString() &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;\t HashCode:&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; arr[i] .GetHashCode());            &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;这里输出HashCode和ToString()查看&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;30&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" alt="" /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;31&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" alt="" /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;32&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;img align="top" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" alt="" /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
相 信上面的代码很容易看的懂..在我的Class2类中覆写了GetHashCode() ,ToString() ,Equals(object o),并重载了==运算符和!=运算符..将传递的id作为HashCode,然后判断当前传递的对象Object.GetHashCode是否等于当前 对象的GetHashCode..这样就解决了ArrayList.Contains不能对Class做出正确判断的问题..&lt;br /&gt;
&lt;br /&gt;
另外,还有 一个容器Hashtable的使用和判断,并不能用上面的方法解决..因为Hashtable.Contains的实现方法是 IDictionary.Contains来做判断..需要实现IDictionary接口的方法才可以.因为牵涉到的内容比较多.所以不能在这里全部写 完..关于具体的方法和实现,我会找时间写出来的..&lt;br /&gt;
&lt;br /&gt;
最后大家可以自己做一个没有实现Equals方法的类,再用ArrayList.Contains来做判断..可以看到结果都是flase..和上面的代码是个对比..&lt;br /&gt;
这个方法不仅可以用在ArrayList,而且也可以在多个地方使用,比如两个Class之间的关联?Class1和Class2是否关联??&lt;br /&gt;
&lt;br /&gt;
Learn Scott:希望本文能对你有所帮助。&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/564.aspx" width="1" height="1" /&gt;</description><dc:creator>Databinder</dc:creator></item><item><title>mssql中的uniqueidentifier数据类型</title><link>http://blog.hidotnet.com/Databinder/archive/2007/06/22/359.aspx</link><pubDate>Fri, 22 Jun 2007 02:55:32 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2007/06/22/359.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/359.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/359.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2007/06/22/359.aspx#comment</comments><slash:comments>1</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/359.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">mssql中的uniqueidentifier数据类型</source><description>&lt;div&gt;
&lt;h5&gt;最近新换了一个工作，在一个全国连锁的服装公司总部做开发，管理全国的分店进销存等的管理，以前从来没有用过&lt;font face="Arial"&gt;uniqueidentifier&lt;/font&gt;这个数据类型，在分布式开发中比较常用，下面是此数据类型的相关介绍。&lt;/h5&gt;
&lt;h5&gt;全局唯一标识符&lt;/h5&gt;
&lt;p&gt;尽管 IDENTITY 属性自动为表生成行号，但不同表的标识符列可以生成相同的行号。这是因为 IDENTITY 属性只须在所使用的表上保持唯一。如果应用程序需要生成在整个数据库或世界各地所有网络计算机的全部数据库中均为唯一的标识符列，请使用 ROWGUIDCOL 属性、&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型和 NEWID 函数。 &lt;/p&gt;
&lt;p&gt;使用 ROWGUIDCOL 属性定义全局唯一标识符列时应注意； &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;一个表只能有一个 ROWGUIDCOL 列，且该列必须定义为 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;SQL Server 不为该列自动生成值。若要插入全局唯一数值，应为列创建 DEFAULT 定义，以使用 NEWID 功能生成全局唯一数值。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;在设置 ROWGUIDCOL 属性后，使用 ROWGUIDCOL 关键字可在选择列表中引用该列。这与使用 IDENTITYCOL 关键字引用 IDENTITY 列相似。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;可使用 OBJECTPROPERTY 函数确定表是否含有 ROWGUIDCOL 列，使用 COLUMNPROPERTY 函数确定 ROWGUIDCOL 列的名称。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;由于 ROWGUIDCOL 属性不强制唯一性，所以应使用 UNIQUE 约束以确保插入 ROWGUIDCOL 列的值是唯一的。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型存储 16 字节的二进制值，该值的使用与全局唯一标识符 (GUID) 一样。GUID 是一个唯一的二进制数字；世界上的任何两台计算机都不会生成重复的 GUID 值。GUID 主要用于在拥有多个节点、多台计算机的网络中，分配必须具有唯一性的标识符。 &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 列的 GUID 值通常由以下方式获得： &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;在 Transact-SQL 语句、批处理或脚本中调用 NEWID 函数。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;在应用程序代码中，调用返回 GUID 值的应用程序 API 函数或方法。 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Transact-SQL NEWID 函数以及应用程序 API 函数和方法从它们网卡上的标识数字以及 CPU 时钟的唯一数字生成新的 &lt;strong&gt;uniqueidentifier &lt;/strong&gt;值。每个网卡都有唯一的标识号。由 NEWID&lt;strong&gt; &lt;/strong&gt;返回的&lt;strong&gt; uniqueidentifier&lt;/strong&gt; 使用服务器上的网卡生成。由应用程序 API 函数和方法返回的&lt;strong&gt; uniqueidentifier&lt;/strong&gt; 使用客户机上的网卡生成。 &lt;/p&gt;
&lt;p&gt;一般不将 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 定义为常量，因为很难保证实际创建的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 具有唯一性。指定 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 常量的方法有两种： &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;字符串格式
    &lt;pre&gt;&lt;code&gt;'6F9619FF-8B86-D011-B42D-00C04FC964FF'
&lt;/code&gt;&lt;/pre&gt;
    &lt;/li&gt;
    &lt;li&gt;二进制格式
    &lt;pre&gt;&lt;code&gt;0xff19966f868b11d0b42d00c04fc964ff
&lt;/code&gt;&lt;/pre&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型不象IDENTITY 属性那样为新插入的行自动生成新的ID。为了得到新的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 值，表必须具有一个指定 NEWID 函数的 DEFAULT 子句，或使用 NEWID 函数的 INSERT 语句：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;CREATE TABLE MyUniqueTable
   (UniqueColumn   UNIQUEIDENTIFIER      DEFAULT NEWID(),
   Characters      VARCHAR(10) )
GO
INSERT INTO MyUniqueTable(Characters) VALUES ('abc')
INSERT INTO MyUniqueTable VALUES (NEWID(), 'def')
GO
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 列可以包含多次出现的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 值，除非也对此列指定了 UNIQUE 或 PRIMARY KEY 约束。当有多行引用源表中的同一主键时，引用其它表的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 主键的外键列将包含多次出现的个别 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 值。 &lt;/p&gt;
&lt;p&gt;一个表可以有多个 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 列。每个表中可以指定一个具有 ROWGUIDCOL 属性的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 列。ROWGUIDCOL 属性表明此列的 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 值唯一地标识表中的行。但是，该属性并没有执行该唯一性。唯一性必须通过其它机制来执行，比如为列指定 PRIMARY KEY 约束。ROWGUIDCOL 属性主要用于 SQL Server 复制。 &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型的主要优点是保证由 Transact-SQL NEWID 函数或应用程序 GUID 函数生成的值在全球是唯一的。 &lt;/p&gt;
&lt;p&gt; &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型的具有几个缺点： &lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;值长且难懂。这使用户难以正确键入它们，并且更难记住。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;这些值是随机的，而且它们不能接受任何使它们对用户变得更有意义的模式。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;没有任何方式可以决定生成 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 值的顺序。它们不适用于那些依赖递增的键值的现有应用程序。&lt;br /&gt;
    &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;uniqueidentifier&lt;/strong&gt; 数据类型具有 16 个字节，与其它那些诸如 4 字节的整数相比要相对大一些。这意味着使用 &lt;strong&gt;uniqueidentifier&lt;/strong&gt; 键建立的索引可能会比使用 &lt;strong&gt;int&lt;/strong&gt; 键实现的索引相对慢一些。 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;在设计分布式数据库时非常有用。&lt;/p&gt;
&lt;/div&gt;&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/359.aspx" width="1" height="1" /&gt;</description><dc:creator>Databinder</dc:creator></item><item><title>SQL引发的血案</title><link>http://blog.hidotnet.com/wangzhe/archive/2007/06/20/343.aspx</link><pubDate>Wed, 20 Jun 2007 10:34:04 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/wangzhe/archive/2007/06/20/343.aspx</guid><wfw:comment>http://blog.hidotnet.com/wangzhe/comments/343.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/wangzhe/comments/commentRss/343.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/wangzhe/archive/2007/06/20/343.aspx#comment</comments><slash:comments>494</slash:comments><trackback:ping>http://blog.hidotnet.com/wangzhe/services/trackbacks/343.aspx</trackback:ping><source url="http://blog.hidotnet.com/wangzhe/rss.aspx">SQL引发的血案</source><description>先看如下2中SQL写法：&lt;br /&gt;
（1）&lt;br /&gt;
declare @monthstart datetime&lt;br /&gt;
declare @monthend datetime&lt;br /&gt;
declare @minID int&lt;br /&gt;
declare @maxID int&lt;br /&gt;
&lt;br /&gt;
set @monthstart= ‘2006-06-20 17:02:00’&lt;br /&gt;
set @monthend= ‘2006-07-20 17:02:00’&lt;br /&gt;
&lt;br /&gt;
select @minID = min(postid),@maxID = max(postId) from table_posts where postdate between @monthstart and @monthend&lt;br /&gt;
 select @minID,@maxId&lt;br /&gt;
&lt;br /&gt;
（2）&lt;br /&gt;
declare @minID int&lt;br /&gt;
declare @maxID int&lt;br /&gt;
select @minID = min(postid),@maxID = max(postId) from table_posts where postdate between '2006-06-20 17:02:00' and '2006-07-20 17:02:00'&lt;br /&gt;
select @minID,@maxID&lt;br /&gt;
&lt;br /&gt;
这2条语句执行结果会有区别么？&lt;br /&gt;
有？回复告诉俺啥区别被。&lt;br /&gt;
没有。俺也这么想滴。&lt;br /&gt;
&lt;br /&gt;
再描述一下俺查询滴数据量。俺查询滴那个表的数据量是近200万，不算多。&lt;br /&gt;
&lt;br /&gt;
好啦，现在答案揭晓：第一条执行速度N慢，相对于第二条来说，多浪费20多秒的时间。&lt;br /&gt;
你别问俺为啥，俺也郁闷，至今未找到根子。不过在轻舞flash老哥的帮助下，还是找到了两者差距的所在。第一条逻辑读9万多，比第二条多9万多。汗一个。。。。&lt;br /&gt;
不是啥子数据库服务器的缘故，就算是俺也不知道，因为服务器不是俺设置的。&lt;br /&gt;
&lt;br /&gt;
但你非得在查询条件中使用变量怎么办？牛人自有牛人的办法。还是flash老哥给的方法，贴出来共享。不过上面的问题谁碰到过可要联系俺啊。&lt;br /&gt;
&lt;br /&gt;
另类解决方案闪亮登场：&lt;br /&gt;
declare @monthstart datetime&lt;br /&gt;
declare @monthend datetime&lt;br /&gt;
declare @minD int&lt;br /&gt;
declare @maxID int&lt;br /&gt;
declare @sqlcom varchar(8000)&lt;br /&gt;
set @monthstart='2006-06-20 17:02:00'&lt;br /&gt;
set @monthend='2006-07-20 17:02:00'&lt;br /&gt;
&lt;br /&gt;
set @sqlcom='select min(postid) as minId, max(postId) as maxId from forums_posts where postdate between '''+Convert(varchar(16),@monthstart,121) +''' and '''+ Convert(varchar(16),@monthend ,121)+''''&lt;br /&gt;
print @sqlcom&lt;br /&gt;
&lt;br /&gt;
exec(@sqlcom)&lt;br /&gt;
&lt;br /&gt;
走过，路过，要记得留过。。。&lt;br /&gt;
鄙视看帖不回的，俺多辛苦的文章啊！&lt;br /&gt;
&lt;br /&gt;
PS：&lt;br /&gt;
可能是表的问题，因为我在另一个表执行类似第一条那样的语句，速度很快。另一个表的字段同样有索引。&lt;br /&gt;
PS：&lt;br /&gt;
以上2种不同的语句，如果不带Min、Max函数，则他们时间上相差无几。而且读盘一样。难道是Min、Max函数搞怪？&lt;img src="http://blog.hidotnet.com/wangzhe/aggbug/343.aspx" width="1" height="1" /&gt;</description><dc:creator>wangzhe</dc:creator></item><item><title>Google 博客搜索 Ping 服务应用</title><link>http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx</link><pubDate>Thu, 14 Jun 2007 09:02:49 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx</guid><wfw:comment>http://blog.hidotnet.com/venjiang/comments/275.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/venjiang/comments/commentRss/275.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/venjiang/archive/2007/06/14/275.aspx#comment</comments><slash:comments>416</slash:comments><trackback:ping>http://blog.hidotnet.com/venjiang/services/trackbacks/275.aspx</trackback:ping><source url="http://blog.hidotnet.com/venjiang/rss.aspx">Google 博客搜索 Ping 服务应用</source><description>&lt;img width="10" height="1" src="file:///clear.gif" alt="" /&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;span style="background-color: rgb(0, 0, 255); color: rgb(255, 255, 255);"&gt;Google Ping 介绍&lt;/span&gt;&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;通 过 Google“博客搜索”Ping API, 用户可以程序化的方式将博客内容的更新通知给 Google“博客搜索”引擎。这对于经常更新博客内容的用户尤其有用。博客服务提供商的管理人员也可以利用此API将其平台上的博客内容变化向 Google 通告，以便 Google“博客搜索”及时抓取来自这一服务提供商的最新内容。为设置对 Google“博客搜索”的自动 Ping 机制，请按照如下所述设置XML-RPC客户端或REST客户端以发送请求。您可以任选一种方法进行通知；两者都将按照相同的方式进行处理。&lt;/font&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;font size="-1"&gt; &lt;a name="about"&gt;&lt;/a&gt; &lt;/font&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt;设置XML-RPC客户&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;XML-RPC客户的请求应包含如下元素：&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; &lt;strong&gt;RPC端点：&lt;/strong&gt; http://blogsearch.google.com/ping/RPC2 &lt;br /&gt;
&lt;strong&gt;调用方法名：&lt;/strong&gt;  weblogUpdates.extendedPing &lt;br /&gt;
&lt;strong&gt;参数：&lt;/strong&gt; (应按照如下所列的相同顺序传送)
&lt;ul&gt;
    &lt;li&gt; 站点名 &lt;/li&gt;
    &lt;li&gt; 站点URL &lt;/li&gt;
    &lt;li&gt; 需要检查更新的页面URL &lt;/li&gt;
    &lt;li&gt; 相应的RSS、RDF或Atom种子的URL &lt;/li&gt;
    &lt;li&gt; &lt;em&gt;可选&lt;/em&gt; 页面内容的分类名称(或标签)。您可以指定多个值，之间用'|'字符进行分隔。 &lt;/li&gt;
&lt;/ul&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; XML-RPC响应中将返回含有两个元素的&amp;lt;struct&amp;gt; ：
&lt;ul&gt;
    &lt;li&gt; flerror (Boolean)：当有错误发生时设为true/1 &lt;/li&gt;
    &lt;li&gt; message (string) ："Thanks for the ping." (如果成功) 或者一个错误信息(如果不成功)。 &lt;/li&gt;
&lt;/ul&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt; &lt;strong&gt;XML-RPC请求的例子&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;hr noshade="noshade" /&gt;
&lt;code&gt; &lt;/code&gt;
&lt;pre&gt;POST /RPC2 HTTP/1.0&lt;br /&gt;User-Agent: request&lt;br /&gt;Host: blogsearch.google.com&lt;br /&gt;Content-Type: text/xml&lt;br /&gt;Content-length: 447&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;methodCall&amp;gt;&lt;br /&gt;  &amp;lt;methodName&amp;gt;weblogUpdates.extendedPing&amp;lt;/methodName&amp;gt;&lt;br /&gt;  &amp;lt;params&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;Official Google Blog&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;http://googleblog.blogspot.com/atom.xml&amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;  &amp;lt;/params&amp;gt;&lt;br /&gt;&amp;lt;/methodCall&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;XML-RPC响应的例子&lt;/strong&gt;&lt;/font&gt; &lt;/p&gt;
&lt;hr noshade="noshade" /&gt;
&lt;code&gt; &lt;/code&gt;
&lt;pre&gt;HTTP/1.1 200 OK&lt;br /&gt;Connection: close&lt;br /&gt;Content-Length: 451&lt;br /&gt;Content-Type: text/xml&lt;br /&gt;Date: Sun, 30 Sep 2001 20:02:30 GMT&lt;br /&gt;Server: Apache&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;methodResponse&amp;gt;&lt;br /&gt;  &amp;lt;params&amp;gt;&lt;br /&gt;    &amp;lt;param&amp;gt;&lt;br /&gt;      &amp;lt;value&amp;gt;&lt;br /&gt;        &amp;lt;struct&amp;gt;&lt;br /&gt;          &amp;lt;member&amp;gt;&lt;br /&gt;            &amp;lt;name&amp;gt;flerror&amp;lt;/name&amp;gt;&lt;br /&gt;            &amp;lt;value&amp;gt;&lt;br /&gt;              &amp;lt;boolean&amp;gt;0&amp;lt;/boolean&amp;gt;&lt;br /&gt;            &amp;lt;/value&amp;gt;&lt;br /&gt;          &amp;lt;/member&amp;gt;&lt;br /&gt;          &amp;lt;member&amp;gt;&lt;br /&gt;            &amp;lt;name&amp;gt;message&amp;lt;/name&amp;gt;&lt;br /&gt;              &amp;lt;value&amp;gt;Thanks for the ping.&amp;lt;/value&amp;gt;&lt;br /&gt;          &amp;lt;/member&amp;gt;&lt;br /&gt;        &amp;lt;/struct&amp;gt;&lt;br /&gt;      &amp;lt;/value&amp;gt;&lt;br /&gt;    &amp;lt;/param&amp;gt;&lt;br /&gt;  &amp;lt;/params&amp;gt;&lt;br /&gt;&amp;lt;/methodResponse&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;font size="-1"&gt; &lt;a name="about"&gt;&lt;/a&gt; &lt;/font&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt; 设置REST客户&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;REST客户的请求中包含如下元素：&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;URL:&lt;/strong&gt; http://blogsearch.google.com/ping&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;参数:&lt;/strong&gt;
&lt;ul&gt;
    &lt;li&gt;name = 博客的名字&lt;/li&gt;
    &lt;li&gt;url = 博客的URL&lt;/li&gt;
    &lt;li&gt;changesURL = RSS、RDF或Atom种子的URL (可选)&lt;/li&gt;
&lt;/ul&gt;
响应中将返回文本内容，在成功的时候是"Thanks for the ping."，在失败时是一条错误消息。 &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="-1"&gt;&lt;strong&gt;例子：&lt;/strong&gt; &lt;/font&gt;&lt;/p&gt;
&lt;textarea cols="85" readonly="readonly"&gt;http://blogsearch.google.com/ping?name=Official+Google+Blog&amp;amp;url=http%3A%2F%2Fgoogleblog.blogspot.com%2F&amp;amp;changesURL=http%3A%2F%2Fgoogleblog.blogspot.com%2Fatom.xml &lt;/textarea&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h1 style="margin-top: 10px;"&gt; &lt;font size="-1"&gt;
&lt;table width="100%" cellspacing="0" cellpadding="2" border="0"&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td style="border-top: 1px solid rgb(255, 158, 33); background-color: rgb(248, 223, 168);"&gt; &lt;font color="#000000"&gt; changes.xml的格式&lt;/font&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/font&gt;&lt;/h1&gt;
&lt;p&gt;&lt;font size="-1"&gt;Google 将所接受的“博客搜索” Ping 记录以XML格式发布到&lt;a href="http://blogsearch.google.com/changes.xml" target="_top"&gt;http://blogsearch.google.com/changes.xml&lt;/a&gt;。changes.xml文件格式包含一个根元素&amp;lt;weblogUpdates&amp;gt;和一个或多个的&amp;lt;weblog&amp;gt;元素。&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;weblogUpdates version="2" updated="Wed, 30 May 2006 14:10:00 GMT" count="1384779"&amp;gt;&lt;br /&gt;  &amp;lt;weblog name="Some Blog"&lt;br /&gt;          url="http://googleblog.blogspot.com" &lt;br /&gt;          rssUrl="http://googleblog.blogspot.com/atom.xml"&lt;br /&gt;          when="1"/&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/weblogUpdates&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;font size="-1"&gt;
&lt;h4&gt;&lt;a name="weblogUpdates_element"&gt; &amp;lt;weblogUpdates&amp;gt;元素&lt;/a&gt;&lt;/h4&gt;
&lt;/font&gt; &lt;font size="-1"&gt; &lt;/font&gt;
&lt;ul&gt;&lt;font size="-1"&gt;
    &lt;li&gt; &lt;strong&gt;version&lt;/strong&gt;：用来指示一个主要的格式变化，目前的版本是2。  &lt;/li&gt;
    &lt;li&gt; &lt;strong&gt;updated&lt;/strong&gt;：以 &lt;a href="http://www.w3.org/Protocols/rfc1945/rfc1945" target="_top"&gt;HTTP 1.0&lt;/a&gt;格式表示的日期时间。它指示了该文件上一次更新的时间。 &lt;/li&gt;
    &lt;li&gt; &lt;strong&gt;count&lt;/strong&gt;：一个递增的数字，表示了changes.xml文件的版本。新版本changes.xml文件通常具有更大的count值。 &lt;/li&gt;
    &lt;/font&gt;&lt;/ul&gt;
    &lt;p&gt;   &lt;font size="-1"&gt;
    &lt;h4&gt;&lt;a name="weblog_element"&gt; &amp;lt;weblog&amp;gt;元素 &lt;/a&gt;&lt;/h4&gt;
    &lt;/font&gt;  &lt;font size="-1"&gt;
    &lt;ul&gt;
        &lt;li&gt; &lt;strong&gt;name&lt;/strong&gt;：Blog的名称。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;url&lt;/strong&gt;： Blog的url。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;rssUrl&lt;/strong&gt;： 相应的RSS、Atom或其它种子的URL。 &lt;/li&gt;
        &lt;li&gt; &lt;strong&gt;when&lt;/strong&gt;： &amp;lt;weblogUpdates&amp;gt;元素的updated属性对应的时间减去相应的 Ping 发生的时间的差值，单位为秒。&lt;/li&gt;
    &lt;/ul&gt;
    ====================================================================&lt;/font&gt;&lt;/p&gt;
    &lt;p style="font-weight: bold; background-color: rgb(0, 0, 255); color: rgb(255, 255, 255);"&gt;&lt;font size="-1"&gt;下面实现如何使用XML RPC编程实现Google Ping服务.&lt;/font&gt;&lt;/p&gt;
    &lt;p&gt;&lt;font size="-1"&gt;首先,下载&lt;a href="http://www.xml-rpc.net/"&gt;CookComputing.XmlRpc&lt;/a&gt; &lt;br /&gt;
    &lt;/font&gt;&lt;/p&gt;
    &lt;p&gt;&lt;font size="-1"&gt;我使用的是2.0版本.最新版为2.1.0&lt;/font&gt;&lt;/p&gt;
    &lt;p style="font-weight: bold;"&gt;1.建立xml rpc客户端&lt;/p&gt;
    &lt;p&gt; public class GoogleXmlRpc&lt;br /&gt;
        {&lt;br /&gt;
            /// &amp;lt;summary&amp;gt;&lt;br /&gt;
            /// 返回值,用于处理Google Ping返回值的结构&lt;br /&gt;
            /// &amp;lt;/summary&amp;gt;&lt;br /&gt;
            public struct ReturnValue&lt;br /&gt;
            {&lt;br /&gt;
                public bool flerror;&lt;br /&gt;
                public string message;&lt;br /&gt;
            }&lt;br /&gt;
    &lt;br /&gt;
            [XmlRpcUrl("http://blogsearch.google.com/ping/RPC2")]&lt;br /&gt;
            public interface IGooglePing : IXmlRpcProxy&lt;br /&gt;
            {&lt;br /&gt;
                [XmlRpcMethod("weblogUpdates.extendedPing")]&lt;br /&gt;
                ReturnValue Ping(string websiteName, string websiteUrl, string changedUrl, string feedUrl);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
        }&lt;/p&gt;
    &lt;br /&gt;
    &lt;p style="font-weight: bold;"&gt;2.向Google发出一个ping通告&lt;/p&gt;
    &lt;p&gt;在你的程序添加文章或更新文章时,发出ping通告.&lt;/p&gt;
    &lt;p&gt;        string websiteName="venjiang 的博客";                                                    // 博客名称&lt;br /&gt;
            string websiteUrl="http://blog.hidotnet.com/venjiang/";        // 博客网站地址&lt;br /&gt;
            string changeUrl = "http://blog.hidotnet.com/venjiang/";                             // 要更新的地址&lt;br /&gt;
            string feedUrl = "http://blog.hidotnet.com/venjiang/Rss.aspx";             // 聚合地址rss或atom&lt;/p&gt;
    &lt;p&gt;        GoogleXmlRpc.IGooglePing proxy = (GoogleXmlRpc.IGooglePing)XmlRpcProxyGen.Create(typeof(GoogleXmlRpc.IGooglePing));    // 创建代理类&lt;/p&gt;
    &lt;p&gt;        // 最新版本,支持泛型,可以直接使用: &lt;br /&gt;
    &lt;/p&gt;
    &lt;p&gt;       // GoogleXmlRpc.IGooglePing proxy =XmlRpcProxyGen.Create&amp;lt;GoogleXmlRpc.IGooglePing&amp;gt;();&lt;/p&gt;
    &lt;p&gt;        GoogleXmlRpc.ReturnValue returnValue = proxy.Ping(websiteName, websiteUrl, changeUrl, feedUrl);    // ping&lt;br /&gt;
    &lt;/p&gt;
    &lt;p&gt;        if (returnValue.flerror)&lt;br /&gt;
                Response.Write( "Google Ping 出错!");&lt;br /&gt;
            else&lt;br /&gt;
                Response.Write "Google Ping 成功!";&lt;/p&gt;
    &lt;br /&gt;
    &lt;p style="font-weight: bold;"&gt;3.查看google 更新列表&lt;/p&gt;
    &lt;p&gt;下载:&lt;font size="-1"&gt;&lt;a href="http://blogsearch.google.com/changes.xml" target="_top"&gt;http://blogsearch.google.com/changes.xml&lt;/a&gt; 你可以看到你的博客相关信息已加入更新列表,目前google更新列表,有一定延迟.&lt;br /&gt;
    &lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/venjiang/aggbug/275.aspx" width="1" height="1" /&gt;</description><dc:creator>venjiang</dc:creator></item><item><title>关于The project file '' has been renamed or is no longer in the solution.的错误</title><link>http://blog.hidotnet.com/Databinder/archive/2007/06/12/226.aspx</link><pubDate>Tue, 12 Jun 2007 01:00:38 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2007/06/12/226.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/226.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/226.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2007/06/12/226.aspx#comment</comments><slash:comments>0</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/226.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">关于The project file '' has been renamed or is no longer in the solution.的错误</source><description>&lt;p&gt;&lt;font face="Arial"&gt;有一个solution，里面有5个project，其中有一个project我删掉了，打开solution的时候提示无法加载，我就把这个project给Remove掉了，结果发现无法编译，提示如下：&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;The project file '' has been renamed or is no longer in the solution.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;仔细想了一下，IDE无法编译，肯定是别的项目有引用这个project的DLL，于是我把别的project所有引用在bin文件夹中的的全部删掉，还是发现无法编译。郁闷。&lt;font face="Arial"&gt;到google上查了一下，只找到&lt;a href="http://www.thescripts.com/forum/thread102940.html"&gt;一个方法&lt;/a&gt;说是重新建立这个project，我晕。&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;难道要我重新返工到移除项目以前(移除项目前是可以编译的，虽然项目加载不到)？&lt;/p&gt;
&lt;p&gt;不死心，在应用这个项目的DLL的项目的References中，我找到了这个引用，显示的是引用项目，把这个DLL的引用移除掉，OK，可以编译了，看来以后引用项目的时候，在bin文件删除的仅仅是物理的copy到本地的dll文件，而要删除引用，还是要在References中把这个引用彻底移除掉。&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/226.aspx" width="1" height="1" /&gt;</description><dc:creator>Databinder</dc:creator></item><item><title>今天是2007年6月6日，开博纪念</title><link>http://blog.hidotnet.com/Databinder/archive/2007/06/06/188.aspx</link><pubDate>Wed, 06 Jun 2007 01:16:16 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/Databinder/archive/2007/06/06/188.aspx</guid><wfw:comment>http://blog.hidotnet.com/Databinder/comments/188.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/Databinder/comments/commentRss/188.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/Databinder/archive/2007/06/06/188.aspx#comment</comments><slash:comments>1</slash:comments><trackback:ping>http://blog.hidotnet.com/Databinder/services/trackbacks/188.aspx</trackback:ping><source url="http://blog.hidotnet.com/Databinder/rss.aspx">今天是2007年6月6日，开博纪念</source><description>&lt;p&gt;&lt;font face="Arial"&gt;现在是2007年6月6日9点15分，&lt;/font&gt;&lt;font face="Arial"&gt;以后就在博客苑落户了，以前从来没有系统的写过什么东西，要好好锻炼一下自己的文笔了。&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;文章浅薄，各位前辈见笑了。&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;//多好的日子啊，66大顺。&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/Databinder/aggbug/188.aspx" width="1" height="1" /&gt;</description><dc:creator>Blog Author</dc:creator></item><item><title>程序错误：将截断字符串或二进制数据。</title><link>http://blog.hidotnet.com/wangzhe/archive/2007/06/01/159.aspx</link><pubDate>Fri, 01 Jun 2007 10:27:49 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/wangzhe/archive/2007/06/01/159.aspx</guid><wfw:comment>http://blog.hidotnet.com/wangzhe/comments/159.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/wangzhe/comments/commentRss/159.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/wangzhe/archive/2007/06/01/159.aspx#comment</comments><slash:comments>39</slash:comments><trackback:ping>http://blog.hidotnet.com/wangzhe/services/trackbacks/159.aspx</trackback:ping><source url="http://blog.hidotnet.com/wangzhe/rss.aspx">程序错误：将截断字符串或二进制数据。</source><description>&lt;p&gt;今日同事说论坛后台编辑不了，我跟踪一下，发现程序并无异常报告。分析后认为是数据库错误，于是执行SQL语句排错。经测试，发现修改字段时，使用较长的字符串时报如下错误：&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;将截断字符串或二进制数据。&lt;br /&gt;
语句已终止。&lt;br /&gt;
&lt;/font&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;记得以前也碰到过这样的错误，确实是数据库错误。从错误信息提示分析，容易让人以为是非法字符引起的，我初步也这么认为(呵呵，以前碰到这个错误的原因不记得了！)，于是排除几个认为非法的字符(还好仅仅是几个字符，不然我也不会找到真正的原因了。)，F5，错误信息依旧，于是看某个字段的长度，将测试字符串缩短后F5，执行成功！看来报这个错是输入的数据超过字段长度的缘故了。从错误提示信息分析，根据“截断”2字就容易让我以为是输入了非法字符，但经过这次测试，我觉得“截断”应该是某个东西过长，过大，而被截断一部分的意思，而不是我们理解的“过滤掉”这个意思。&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;我根据自己想法进行了几个测试。首先在输入数据末尾使用空格，以此是输入数据超过字段长度，F5，以为会报错，显示执行成功！换一种方式，将空格放输入数据中间，报错！难道SQl中有Trim？呵呵，哪位高人指点一二？&lt;/font&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blog.hidotnet.com/wangzhe/aggbug/159.aspx" width="1" height="1" /&gt;</description><dc:creator>wangzhe</dc:creator></item><item><title>利用userData实现客户端保存表单数据[转的]</title><link>http://blog.hidotnet.com/wangzhe/archive/2007/03/15/120.aspx</link><pubDate>Thu, 15 Mar 2007 08:50:29 GMT</pubDate><guid isPermaLink="true">http://blog.hidotnet.com/wangzhe/archive/2007/03/15/120.aspx</guid><wfw:comment>http://blog.hidotnet.com/wangzhe/comments/120.aspx</wfw:comment><wfw:commentRss>http://blog.hidotnet.com/wangzhe/comments/commentRss/120.aspx</wfw:commentRss><comments>http://blog.hidotnet.com/wangzhe/archive/2007/03/15/120.aspx#comment</comments><slash:comments>1</slash:comments><trackback:ping>http://blog.hidotnet.com/wangzhe/services/trackbacks/120.aspx</trackback:ping><source url="http://blog.hidotnet.com/wangzhe/rss.aspx">利用userData实现客户端保存表单数据[转的]</source><description>对于多数网页制作的朋友，实现在客户端保存在网页表单上的信息，比较多的是采用Cookie技术来实现，这些功能例如：下拉列表框选择的选项，文本框输入的数据等。事实上，我们可以利用微软DHTML默认行为中的userData行为来实现这个功能。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
因为很多网友问到这样的问题，整理了一下，并提供了三个示例。下面将就该行为的使用做一个介绍： &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UserData 行为（userData Behavior）： &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1、说明： &lt;br /&gt;
&lt;br /&gt;
userData行为通过将数据写入一个UserData存储区（UserData store）来保存数据，userData可以将数据以XML格式保存在客户端计算机上，如果你用的是 Windows 2000 或者 Windows XP，是保存在C:\Documents and Settings\Liming\UserData\文件夹下（如果操作系统不是安装在C盘，那么C就应该是操作系统所在的分区）。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
该数据将一直存在，除非你人为删除或者用脚本设置了该数据的失效期。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
userData行为提供了一个比Cookie更具有动态性和更大容量的数据结构。每页的UserData存储区数据大小可以达到64 Kb，每个域名可以达到640 Kb。 &lt;br /&gt;
&lt;br /&gt;
userData行为通过sessions为每个对象分配UserData存储区。使用save和load方法将UserData存储区数据保存在缓存（cache）中。一旦UserData存储区保存以后，即使IE浏览器关闭或者刷新了，下一次进入该页面，数据也能够重新载入而不会丢失。 &lt;br /&gt;
&lt;br /&gt;
出于安全的考虑，相同协议使用同一个文件夹保存UserData存储区数据。 &lt;br /&gt;
&lt;br /&gt;
For security reasons, a UserData store is available only in the same directory and with the same protocol used to persist the store. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
在HTML、HEAD、TITLE和STYLE标记上应用了userData行为后使用save和load方法将会出错。 &lt;br /&gt;
Setting the userData behavior (proposed) class on the HTML, HEAD, TITLE, or STYLE object causes an error when the save or load method is called. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
必须在行内或者文档的HEAD部分宣告如下样式： &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;STYLE&amp;gt; &lt;br /&gt;
      .userData {behavior:url(#default#userdata);} &lt;br /&gt;
   &amp;lt;/STYLE&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
userData行为可用于Microsoft? Win32?和Unix平台上的IE 5.0以上版本，不支持Netscape。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2、语法： &lt;br /&gt;
&lt;br /&gt;
HTML     &amp;lt;ELEMENT STYLE="behavior:url('#default#userData')" ID=sID&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Script     object.style.behavior = "url('#default#userData')" &lt;br /&gt;
&lt;br /&gt;
             object.addBehavior ("#default#userData") &lt;br /&gt;
&lt;br /&gt;
注：sID参数是一个可以描述该标记的唯一id。ID是可选的，但如果有，可以在脚本中方便地对该标记加以控制。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3、成员： &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
expires &lt;br /&gt;
&lt;br /&gt;
  设置或取得使用userData行为保存数据的失效日期。 &lt;br /&gt;
&lt;br /&gt;
    脚本语法：对象ID.expires = 参数 &lt;br /&gt;
&lt;br /&gt;
    参数是一个使用UTC（Universal Time Coordinate，世界调整时间）格式表示失效日期的字符串。该属性可以读写，没有默认值。浏览器会对比这个日期和当前日期，如果到期，该数据就自动失效。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
getAttribute() &lt;br /&gt;
  取得指定的属性值。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
load(存储区名) &lt;br /&gt;
  从UserData存储区载入存储的对象数据。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
removeAttribute() &lt;br /&gt;
  从对象中删除指定的属性值。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
save(存储区名) &lt;br /&gt;
  将对象数据存入一个UserData存储区。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
setAttribute() &lt;br /&gt;
  设置指定的属性值。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
XMLDocument &lt;br /&gt;
  取得存储该对象数据的XML DOM引用。 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
具体用法可以查看MSDN（&lt;a target="_blank" href="http://msdn.microsoft.com/"&gt;http://msdn.microsoft.com&lt;/a&gt;） 4、示例&lt;br /&gt;
&lt;br /&gt;
示例一：文本框标记的应用（Microsoft）&lt;br /&gt;
&amp;lt;HTML&amp;gt;&lt;br /&gt;
            &amp;lt;HEAD&amp;gt;&lt;br /&gt;
            &amp;lt;STYLE&amp;gt;&lt;br /&gt;
            .userData {behavior:url(#default#userdata);}&lt;br /&gt;
            &amp;lt;/STYLE&amp;gt;&lt;br /&gt;
            &amp;lt;SCRIPT&amp;gt;&lt;br /&gt;
            function fnSaveInput(){&lt;br /&gt;
            var oPersist=oPersistForm.oPersistInput;&lt;br /&gt;
            oPersist.setAttribute("sPersist",oPersist.value); //将oPersist.value存储为sPersist属性&lt;br /&gt;
            oPersist.save("oXMLBranch");  //存储在名为oXMLBranch的UserData存储区&lt;br /&gt;
            }&lt;br /&gt;
            function fnLoadInput(){&lt;br /&gt;
            var oPersist=oPersistForm.oPersistInput;&lt;br /&gt;
            oPersist.load("oXMLBranch");  //载入在名为oXMLBranch的UserData存储区&lt;br /&gt;
            oPersist.value=oPersist.getAttribute("sPersist"); //将sPersist属性赋值给oPersist.value&lt;br /&gt;
            }&lt;br /&gt;
            &amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
            &amp;lt;/HEAD&amp;gt;&lt;br /&gt;
            &amp;lt;BODY&amp;gt;&lt;br /&gt;
            &amp;lt;FORM ID="oPersistForm"&amp;gt;&lt;br /&gt;
            &amp;lt;INPUT CLASS="userData" TYPE="text" ID="oPersistInput"&amp;gt;&lt;br /&gt;
            &amp;lt;INPUT TYPE="button" VALUE="Load" onclick="fnLoadInput()"&amp;gt;&lt;br /&gt;
            &amp;lt;INPUT TYPE="button" VALUE="Save" onclick="fnSaveInput()"&amp;gt;&lt;br /&gt;
            &amp;lt;/FORM&amp;gt;&lt;br /&gt;
            &amp;lt;/BODY&amp;gt;&lt;br /&gt;
            &amp;lt;/HTML&amp;gt;&lt;br /&gt;
 [Ctrl+A 全选,提示:你可修改代码后运行] &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
示例二：Checkbox标记的应用&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
            .userData {behavior:url(#default#userdata);}&lt;br /&gt;
            &amp;lt;/style&amp;gt;&lt;br /&gt;
            &amp;lt;input type=checkbox id=chkbox1 class=userData&amp;gt;&lt;br /&gt;
            &amp;lt;script&amp;gt;&lt;br /&gt;
            var obj=document.all.chkbox1;&lt;br /&gt;
            obj.attachEvent('onclick',saveChecked)&lt;br /&gt;
            function saveChecked(){&lt;br /&gt;
            obj.setAttribute("bCheckedValue",obj.checked);&lt;br /&gt;
            obj.save("oChkValue");&lt;br /&gt;
            }&lt;br /&gt;
            window.attachEvent('onload',loadChecked)&lt;br /&gt;
            function loadChecked(){&lt;br /&gt;
            obj.load("oChkValue");&lt;br /&gt;
            var chk=(obj.getAttribute("bCheckedValue")=="true")?true:false;&lt;br /&gt;
            obj.checked=chk;&lt;br /&gt;
            }&lt;br /&gt;
            &amp;lt;/script&amp;gt;&lt;br /&gt;
 [Ctrl+A 全选,提示:你可修