{"id":2809,"date":"2013-08-24T09:48:41","date_gmt":"2013-08-24T09:48:41","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=2809"},"modified":"2013-08-24T09:54:31","modified_gmt":"2013-08-24T09:54:31","slug":"%e7%bb%99-c-%e5%bc%80%e5%8f%91%e8%80%85%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ae%a1%e6%9f%a5%e6%b8%85%e5%8d%95","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2013\/08\/24\/%e7%bb%99-c-%e5%bc%80%e5%8f%91%e8%80%85%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ae%a1%e6%9f%a5%e6%b8%85%e5%8d%95\/","title":{"rendered":"\u7ed9 C# \u5f00\u53d1\u8005\u7684\u4ee3\u7801\u5ba1\u67e5\u6e05\u5355"},"content":{"rendered":"<h2 style=\"border: 0px; margin: -9px 0px 20px; padding: 0px; font-size: 24px; line-height: 36px; font-family: Arial, sans-serif; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);\">\n\t<a href=\"http:\/\/blog.jobbole.com\/\">\u7ed9 C# \u5f00\u53d1\u8005\u7684\u4ee3\u7801\u5ba1\u67e5\u6e05\u5355<\/a><\/p>\n<p>\t\u53ef\u53c2\u8003\uff1a<\/h2>\n<div>\n\t1. \u786e\u4fdd\u6ca1\u6709\u4efb\u4f55\u8b66\u544a\uff08warnings\uff09\u3002<\/div>\n<div>\n\t2.\u5982\u679c\u5148\u6267\u884cCode Analysis\uff08\u542f\u7528\u6240\u6709Microsoft Rules\uff09\u518d\u6d88\u9664\u6240\u6709\u8b66\u544a\u5c31\u66f4\u597d\u4e86\u3002<\/div>\n<div>\n\t3. \u53bb\u6389\u6240\u6709\u6ca1\u6709\u7528\u5230\u7684usings\u3002\u7f16\u7801\u8fc7\u7a0b\u4e2d\u53bb\u6389\u591a\u4f59\u4ee3\u7801\u662f\u4e2a\u597d\u4e60\u60ef\u3002<\/div>\n<div>\n\t4. \u5728\u5408\u7406\u7684\u5730\u65b9\u68c0\u67e5\u5bf9\u8c61\u662f\u5426\u4e3a&rsquo;null&rsquo;\uff0c\u907f\u514d\u8fd0\u884c\u7684\u65f6\u5019\u51fa\u73b0Null Reference Exception<\/div>\n<div>\n\t5,\u4ee3\u7801\u53ef\u91cd\u7528\u6027\uff1a\u5982\u679c\u4e00\u5757\u4ee3\u7801\u5df2\u7ecf\u88ab\u4f7f\u7528\u8d85\u8fc7\u4e00\u6b21\uff0c\u6216\u8005\u4f60\u5e0c\u671b\u5c06\u6765\u4f7f\u7528\u5b83\uff0c\u8bf7\u63d0\u53d6\u6210\u4e00\u4e2a\u65b9\u6cd5\u3002\u5c06\u91cd\u590d\u7684\u5de5\u4f5c\u505a\u6210\u901a\u7528\u7684\u65b9\u6cd5\u653e\u5728\u76f8\u5173\u7684\u7c7b\u4e2d\u3002<\/div>\n<div>\n\t6,\u786e\u4fdd\u4ee3\u7801\u4e2d\u65b9\u6cd5\u7684\u884c\u6570\u4e0d\u8981\u8fc7\u591a\uff0c\u4e0d\u8d85\u8fc730\u523040\u884c\u3002<\/div>\n<div>\n\t7,\u5355\u5143\u6d4b\u8bd5<\/p>\n<h2 style=\"border: 0px; margin: -9px 0px 20px; padding: 0px; font-size: 24px; line-height: 36px; font-family: Arial, sans-serif; color: rgb(51, 51, 51); background-color: rgb(255, 255, 255);\">\n\t\t\u6e05\u5355<\/h2>\n<\/div>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t1. \u786e\u4fdd\u6ca1\u6709\u4efb\u4f55\u8b66\u544a\uff08warnings\uff09\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t<strong style=\"border: 0px; margin: 0px; padding: 0px;\">2.<\/strong>\u5982\u679c\u5148\u6267\u884c<strong style=\"border: 0px; margin: 0px; padding: 0px;\">Code Analysis<\/strong>\uff08\u542f\u7528\u6240\u6709<em style=\"border: 0px; margin: 0px; padding: 0px;\">Microsoft Rules<\/em>\uff09\u518d\u6d88\u9664\u6240\u6709\u8b66\u544a\u5c31\u66f4\u597d\u4e86\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t3.&nbsp;\u53bb\u6389\u6240\u6709\u6ca1\u6709\u7528\u5230\u7684usings\u3002\u7f16\u7801\u8fc7\u7a0b\u4e2d\u53bb\u6389\u591a\u4f59\u4ee3\u7801\u662f\u4e2a\u597d\u4e60\u60ef\u3002\uff08\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/magazine\/ee335722.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a>\uff09<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t4. \u5728\u5408\u7406\u7684\u5730\u65b9\u68c0\u67e5\u5bf9\u8c61\u662f\u5426\u4e3a&rsquo;null&rsquo;\uff0c\u907f\u514d\u8fd0\u884c\u7684\u65f6\u5019\u51fa\u73b0<em style=\"border: 0px; margin: 0px; padding: 0px;\">Null Reference Exception<\/em><em style=\"border: 0px; margin: 0px; padding: 0px;\">\u3002<\/em><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t5. \u59cb\u7ec8\u9075\u5faa\u547d\u540d\u89c4\u8303\u3002\u4e00\u822c\u800c\u8a00\u53d8\u91cf\u53c2\u6570\u4f7f\u7528\u9a7c\u5cf0\u547d\u540d\u6cd5\uff0c\u65b9\u6cd5\u540d\u548c\u7c7b\u540d\u4f7f\u7528<strong style=\"border: 0px; margin: 0px; padding: 0px;\">Pascal<\/strong>\u547d\u540d\u6cd5\u3002\uff08\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms229043.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a>\uff09<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t6. \u8bf7\u786e\u4fdd\u4f60\u4e86\u89e3SOLID\u539f\u5219\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t\u6839\u636e\u7ef4\u57fa\u767e\u79d1\u5b9a\u4e49\uff1a\u5728\u7a0b\u5e8f\u8bbe\u8ba1\u9886\u57df\uff0c<strong style=\"border: 0px; margin: 0px; padding: 0px;\">SOLID<\/strong>&nbsp;(<strong style=\"border: 0px; margin: 0px; padding: 0px;\">\u5355\u4e00\u529f\u80fd\u3001\u5f00\u95ed\u539f\u5219\u3001\u91cc\u6c0f\u66ff\u6362\u3001\u63a5\u53e3\u9694\u79bb<\/strong>\u4ee5\u53ca<strong style=\"border: 0px; margin: 0px; padding: 0px;\">\u4f9d\u8d56\u53cd\u8f6c<\/strong>)\u662f\u7531\u7f57\u4f2f\u7279&middot;C&middot;\u9a6c\u4e01\u572821\u4e16\u7eaa\u65e9\u671f\u5f15\u5165\u7684\u8bb0\u5fc6\u672f\u9996\u5b57\u6bcd\u7f29\u7565\u5b57\uff0c\u6307\u4ee3\u4e86\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u548c\u9762\u5411\u5bf9\u8c61\u8bbe\u8ba1\u7684\u4e94\u4e2a\u57fa\u672c\u539f\u5219\u3002\u5f53\u8fd9\u4e9b\u539f\u5219\u88ab\u4e00\u8d77\u5e94\u7528\u65f6\uff0c\u5b83\u4eec\u4f7f\u5f97\u4e00\u4e2a\u7a0b\u5e8f\u5458\u5f00\u53d1\u4e00\u4e2a\u5bb9\u6613\u8fdb\u884c\u8f6f\u4ef6\u7ef4\u62a4\u548c\u6269\u5c55\u7684\u7cfb\u7edf\u53d8\u5f97\u66f4\u52a0\u53ef\u80fd\u3002SOLID\u6240\u5305\u542b\u7684\u539f\u5219\u662f\u901a\u8fc7\u5f15\u53d1\u7f16\u7a0b\u8005\u8fdb\u884c\u8f6f\u4ef6\u6e90\u4ee3\u7801\u7684\u4ee3\u7801<span class=\"wp_keywordlink\" style=\"border: 0px; margin: 0px; padding: 0px;\"><a href=\"http:\/\/www.amazon.cn\/gp\/product\/B003BY6PLK\/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=vastwork-23&amp;linkCode=as2&amp;camp=536&amp;creative=3200&amp;creativeASIN=B003BY6PLK\" rel=\"nofollow\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\" target=\"_blank\" title=\"\u91cd\u6784:\u6539\u5584\u65e2\u6709\u4ee3\u7801\u7684\u8bbe\u8ba1\">\u91cd\u6784<\/a><\/span>\u8fdb\u884c\u8f6f\u4ef6\u7684\u4ee3\u7801\u5f02\u5473\u6e05\u626b\uff0c\u4ece\u800c\u4f7f\u5f97\u8f6f\u4ef6\u6e05\u6670\u53ef\u8bfb\u4ee5\u53ca\u53ef\u6269\u5c55\u65f6\u53ef\u4ee5\u5e94\u7528\u7684\u6307\u5357\u3002SOLID\u88ab\u5178\u578b\u7684\u5e94\u7528\u5728<span class=\"wp_keywordlink\" style=\"border: 0px; margin: 0px; padding: 0px;\"><a href=\"http:\/\/www.amazon.cn\/dp\/B0011AP332\/?tag=vastwork-23\" rel=\"nofollow\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\" target=\"_blank\" title=\"\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1\">\u6d4b\u8bd5\u9a71\u52a8\u5f00\u53d1<\/a><\/span>\u4e0a\uff0c\u5e76\u4e14\u662f\u654f\u6377\u5f00\u53d1\u4ee5\u53ca\u81ea\u9002\u5e94\u8f6f\u4ef6\u5f00\u53d1\u7684\u57fa\u672c\u539f\u5219\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/zh.wikipedia.org\/wiki\/SOLID_(%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E8%AE%BE%E8%AE%A1\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">wiki\/SOLID_(\u9762\u5411\u5bf9\u8c61\u8bbe\u8ba1<\/a>)<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t7. \u4ee3\u7801\u53ef\u91cd\u7528\u6027\uff1a\u5982\u679c\u4e00\u5757\u4ee3\u7801\u5df2\u7ecf\u88ab\u4f7f\u7528\u8d85\u8fc7\u4e00\u6b21\uff0c\u6216\u8005\u4f60\u5e0c\u671b\u5c06\u6765\u4f7f\u7528\u5b83\uff0c\u8bf7\u63d0\u53d6\u6210\u4e00\u4e2a\u65b9\u6cd5\u3002\u5c06\u91cd\u590d\u7684\u5de5\u4f5c\u505a\u6210\u901a\u7528\u7684\u65b9\u6cd5\u653e\u5728\u76f8\u5173\u7684\u7c7b\u4e2d\uff0c\u8fd9\u6837\u4e00\u65e6\u4f60\u5b8c\u6210\u522b\u4eba\u5c31\u53ef\u4ee5\u4f7f\u7528\u4e86\u3002\u5c06\u5e38\u7528\u529f\u80fd\u5f00\u53d1\u6210\u7528\u6237\u63a7\u4ef6\uff0c\u8fd9\u6837\u53ef\u4ee5\u8de8\u9879\u76ee\u91cd\u7528\u5b83\u4eec\u3002\uff08\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/office\/aa140806(v=office.10).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">\u2460<\/a>&nbsp;\u3001&nbsp;<a href=\"http:\/\/blogs.msdn.com\/b\/frice\/archive\/2004\/06\/11\/153709.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">\u2461<\/a>\uff09<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t8. \u4ee3\u7801\u4e00\u81f4\u6027\uff1a\u6bd4\u65b9\u8bf4\uff0cInt32\u5199\u6210int\uff0cString\u5199\u6210string\uff0c\u5e94\u8be5\u5728\u4ee3\u7801\u91cc\u4fdd\u6301\u7edf\u4e00\u5f62\u5f0f\u3002\u4e0d\u80fd\u4e00\u4f1a\u4e8c\u5199\u6210int\u4e00\u4f1a\u513f\u5199\u6210Int32\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t9. \u4ee3\u7801\u53ef\u8bfb\u6027\uff1a\u4ee3\u7801\u5e94\u8be5\u662f\u53ef\u7ef4\u62a4\u7684\uff0c\u4fbf\u4e8e\u5176\u4ed6\u5f00\u53d1\u8005\u7406\u89e3\u3002\uff08\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-IN\/library\/aa291591(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a>\uff09<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t10. \u91ca\u653e\u975e\u6258\u7ba1\u8d44\u6e90\uff0c\u6bd4\u5982\u6587\u4ef6I\/O\uff0c\u7f51\u7edc\u8d44\u6e90\u7b49\u3002\u4e00\u65e6\u4f7f\u7528\u7ed3\u675f\u5c31\u5e94\u8be5\u91ca\u653e\u5b83\u4eec\u3002\u5982\u679c\u4f60\u60f3\u4e00\u65e6\u8d85\u51fa\u4f7f\u7528\u8303\u56f4\u5c31\u81ea\u52a8\u91ca\u653e\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528usings\u5c06\u975e\u6258\u7ba1\u4ee3\u7801\u62ec\u8d77\u6765\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/498928w2.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t11. \u5408\u7406\u5b9e\u73b0\u5f02\u5e38\u5904\u7406(try\/catch\u548cfinally\u5757)\u548c\u5f02\u5e38\u8bb0\u5f55\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/ms229005(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t12. \u786e\u4fdd\u4ee3\u7801\u4e2d\u65b9\u6cd5\u7684\u884c\u6570\u4e0d\u8981\u8fc7\u591a\uff0c\u4e0d\u8d85\u8fc730\u523040\u884c\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t13. \u53ca\u65f6\u7528\u4ee3\u7801\u7ba1\u7406\u5de5\u5177check-in\/check-out\u4ee3\u7801\u3002(\u6bd4\u5982TFS) \u53c2\u8003\uff1a<a href=\"http:\/\/www.codeproject.com\/Tips\/593014\/Steps-Check-in-Check-Out-Mechanism-for-TFS-To-avoi\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">codeproject.com<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t14. \u76f8\u4e92\u5ba1\u67e5\u4ee3\u7801\uff1a\u548c\u4f60\u7684\u540c\u4e8b\u4ea4\u6362\u4ee3\u7801\uff0c\u5b9e\u73b0\u5185\u90e8\u5ba1\u67e5\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t15. \u5355\u5143\u6d4b\u8bd5\uff1a\u7f16\u5199\u5f00\u53d1\u6d4b\u8bd5\u7528\u4f8b\u5b8c\u6210\u5355\u5143\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4ee3\u7801\u88ab\u9001\u5230QA\u4ee5\u524d\uff0c\u57fa\u672c\u6d4b\u8bd5\u5b8c\u6210\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/magazine\/cc163665.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t16. \u5c3d\u91cf\u907f\u514dfor\/foreach\u5faa\u73af\u5d4c\u5957\u548cif\u6761\u4ef6\u5d4c\u5957\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t17. \u5982\u679c\u4ee3\u7801\u53ea\u4f1a\u4f7f\u7528\u4e00\u6b21\uff0c\u8bf7\u4f7f\u7528\u533f\u540d\u7c7b\u578b\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/vstudio\/bb397696.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t18. \u5c3d\u91cf\u4f7f\u7528LINQ\u67e5\u8be2\u548cLambda\u8868\u8fbe\u5f0f\uff0c\u589e\u52a0\u53ef\u8bfb\u6027\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/bb308959.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t19. \u5408\u7406\u4f7f\u7528var\u3001object\u548cdynamic\u5173\u952e\u5b57\u3002\u7531\u4e8e\u5f88\u591a\u5f00\u53d1\u8005\u4f1a\u611f\u5230\u56f0\u60d1\u6216\u8005\u77e5\u9053\u7684\u5f88\u5c11\uff0c\u4f1a\u89c9\u5f97\u5b83\u4eec\u6709\u4e9b\u76f8\u4f3c\uff0c\u6545\u800c\u4ea4\u6362\u4f7f\u7528\uff0c\u8fd9\u662f\u8981\u907f\u514d\u7684\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/blogs.msdn.com\/b\/csharpfaq\/archive\/2010\/01\/25\/what-is-the-difference-between-dynamic-and-object-keywords.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">blogs.msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t20. \u4f7f\u7528\u8bbf\u95ee\u9650\u5b9a\u7b26(private, public, protected, internal, protected internal)\u9650\u5b9a\u6bcf\u4e2a\u65b9\u6cd5\u3001\u7c7b\u6216\u53d8\u91cf\u7684\u9700\u8981\u8303\u56f4\u3002\u6bd4\u65b9\u8bf4\u5982\u679c\u4e00\u4e2a\u7c7b\u53ea\u4f1a\u5728\u7a0b\u5e8f\u96c6\u5185\u4f7f\u7528\uff0c\u90a3\u4e48\u5b9a\u4e49\u6210internal\u5c31\u8db3\u591f\u4e86\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/kktasw36.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t21. \u5728\u9700\u8981\u4fdd\u6301\u89e3\u8026\u7684\u5730\u65b9\u4f7f\u7528\u63a5\u53e3\uff0c\u6709\u4e9b<span class=\"wp_keywordlink_affiliate\" style=\"border: 0px; margin: 0px; padding: 0px;\"><a href=\"http:\/\/www.amazon.cn\/gp\/product\/B001130JN8\/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&amp;tag=vastwork-23&amp;linkCode=as2&amp;camp=536&amp;creative=3200&amp;creativeASIN=B001130JN8\" rel=\"nofollow\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\" target=\"_blank\" title=\"1\">\u8bbe\u8ba1\u6a21\u5f0f<\/a><\/span>\u7684\u51fa\u73b0\u4e5f\u662f\u7531\u4e8e\u63a5\u53e3\u7684\u4f7f\u7528\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-IN\/library\/3b5b8ezk(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t22. \u6309\u7167\u7528\u6cd5\u548c\u9700\u8981\u5c06\u7c7b\u5b9a\u4e49\u4e3asealed\u3001static\u6216abstract\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms173150(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t23. \u5982\u679c\u9700\u8981\u591a\u6b21\u4e32\u8054\uff0c\u8bf7\u4f7f\u7528Stringbuilder\u4ee3\u66ffstring\uff0c\u8fd9\u53ef\u4ee5\u8282\u7701\u5806\u5185\u5b58\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t24. \u68c0\u67e5\u662f\u5426\u6709\u4e0d\u53ef\u80fd\u6267\u884c\u7684\u4ee3\u7801\uff0c\u5982\u679c\u6709\uff0c\u8bf7\u4fee\u6539\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t25. \u5728\u6bcf\u4e2a\u65b9\u6cd5\u524d\u6ce8\u91ca\uff0c\u8bf4\u660e\u5b83\u7684\u7528\u6cd5\u3001\u8f93\u5165\u7c7b\u578b\u548c\u8fd4\u56de\u503c\u7c7b\u578b\u4fe1\u606f\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t26. \u4f7f\u7528\u7c7b\u4f3cSilverlight Spy\u7684\u5de5\u5177\uff0c\u68c0\u67e5\u548c\u64cd\u63a7Silverlight\u5e94\u7528\u5728\u8fd0\u884c\u65f6\u5bf9XMAL\u7684\u6e32\u67d3\uff0c\u4ee5\u6b64\u6765\u6539\u5584\u6548\u7387\u3002\u8fd9\u53ef\u4ee5\u5728\u8bbe\u8ba1\u6267\u884cXAML\u65f6\uff0c\u8282\u7701\u5927\u91cf\u9000\u56de\u548c\u6765\u56de\u4fee\u6539\u7684\u65f6\u95f4\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t27. \u4f7f\u7528filddler\u5de5\u5177\u901a\u8fc7\u68c0\u67e5HTTP\/\u7f51\u7edc\u6d41\u91cf\u548c\u5e26\u5bbd\uff0c\u6765\u8ddf\u8e2aweb\u5e94\u7528\u548c\u670d\u52a1\u7684\u6027\u80fd\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t28. \u5982\u679c\u4f60\u60f3\u786e\u8ba4Visual Studio\u4ee5\u5916\u7684\u65b9\u6cd5\uff0c\u8bf7\u4f7f\u7528WCFTestClient.exe\u5de5\u5177\uff0c\u6216\u8005\u88c5\u8f7d\u5b83\u7684\u8fdb\u7a0b\u5230Visual Studio\u6765\u8fdb\u884c\u8c03\u8bd5\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t29. \u5728\u4efb\u4f55\u5408\u7406\u7684\u5730\u65b9\u4f7f\u7528constants\u548creadonly\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/acdd6hb7(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">\/msdn<\/a>\u3001<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/e6w8fe1b(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t30. \u5c3d\u91cf\u907f\u514d\u5f3a\u5236\u8f6c\u6362\u548c\u7c7b\u578b\u8f6c\u6362\uff0c\u56e0\u4e3a\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms173105.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t31. \u5bf9\u4e8e\u4f60\u60f3\u63d0\u4f9b\u81ea\u5b9a\u4e49\u4fe1\u606f\u7684\u7c7b\uff0c\u8bf7\u91cd\u8f7dToString(\u6765\u81eaObject\u7c7b)\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms173154(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t32. \u907f\u514d\u76f4\u63a5\u4ece\u5176\u4ed6\u4ee3\u7801\u4e2dctrl+c\/ctrl+v\u3002\u4e00\u76f4\u5efa\u8bae\u8fd8\u662f\u81ea\u5df1\u7528\u624b\u6572\uff0c\u5373\u4f7f\u4f60\u5df2\u7ecf\u627e\u5230\u76f8\u5173\u4ee3\u7801\u3002\u8fd9\u6837\u53ef\u4ee5\u953b\u70bc\u81ea\u5df1\u5199\u4ee3\u7801\u80fd\u529b\uff0c\u8fd8\u80fd\u6b63\u786e\u7406\u89e3\u90a3\u6bb5\u4ee3\u7801\u7684\u7528\u6cd5\u3002\u6700\u7ec8\u4f60\u6c38\u8fdc\u90fd\u4e0d\u4f1a\u5fd8\u8bb0\u90a3\u6bb5\u4ee3\u7801\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t33. \u4fdd\u6301\u9605\u8bfb\u4e66\u7c4d\u548c\u6587\u7ae0\u7684\u826f\u597d\u4e60\u60ef\uff0c\u9075\u5faa\u5927\u795e\u4eec\u7684\u5b9e\u8df5\u6307\u5bfc\u3002\uff08\u6bd4\u5982\u5fae\u8f6f\u4e13\u5bb6\u548c\u4e00\u4e9b\u8457\u540d\u7684\u4e13\u5bb6\uff0cMartin Fowler, Kent Beck, Jeffrey Ritcher, Ward Cunningham, Scott Hanselman, Scott Guthrie, Donald E Knuth.\uff09<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t34. \u786e\u8ba4\u4ee3\u7801\u662f\u5426\u6709\u5185\u5b58\u6cc4\u6f0f\u3002\u5982\u679c\u6709\uff0c\u8bf7\u786e\u4fdd\u5df2\u4fee\u6b63\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/blogs.msdn.com\/b\/davidklinems\/archive\/2005\/11\/16\/493580.aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">blogs.msdn.com<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t35. \u5c3d\u53ef\u80fd\u53c2\u52a0\u4e13\u5bb6\u4eec\u7ec4\u7ec7\u7684\u6280\u672f\u7814\u8ba8\u4f1a\uff0c\u53ef\u4ee5\u63a5\u89e6\u5230\u6700\u65b0\u7684\u8f6f\u4ef6\u8d8b\u52bf\u3001\u6280\u672f\u548c\u6700\u4f73\u5b9e\u8df5<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t36. \u8981\u900f\u5f7b\u7406\u89e3OOP\u6982\u5ff5\uff0c\u5e76\u5c3d\u53ef\u80fd\u5728\u4ee3\u7801\u91cc\u5b9e\u73b0\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t37. \u77e5\u9053\u9879\u76ee\u8bbe\u8ba1\u67b6\u6784\uff0c\u53ef\u4ee5\u4ece\u6574\u4f53\u4e0a\u7406\u89e3\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t38. \u91c7\u53d6\u5fc5\u8981\u63aa\u65bd\u963b\u6b62\u907f\u514d\u4efb\u4f55\u4ea4\u53c9\u811a\u672c\u653b\u51fb\u3001SQL\u6ce8\u5165\u548c\u5176\u4ed6\u5b89\u5168\u6f0f\u6d1e\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t39. \u6c38\u8fdc\u8bb0\u5f97\u5c06\u4fdd\u5bc6\u548c\u654f\u611f\u4fe1\u606f\u52a0\u5bc6(\u901a\u8fc7\u4f7f\u7528\u597d\u7684\u52a0\u5bc6\u7b97\u6cd5)\uff0c\u6bd4\u5982\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u7684\u5bc6\u7801\u548c\u4fdd\u5b58\u5728web.config\u6587\u4ef6\u4e2d\u7684\u8fde\u63a5\u5b57\u7b26\uff0c\u8981\u907f\u514d\u88ab\u975e\u8ba4\u8bc1\u7684\u7528\u6237\u64cd\u7eb5\u3002<\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t40. \u907f\u514d\u5bf9\u5df2\u77e5\u7c7b\u578b(\u539f\u59cb\u7c7b\u578b)\u4f7f\u7528\u9ed8\u8ba4\u5173\u952e\u5b57\uff0c\u6bd4\u5982int, decimal, bool\u7b49\u3002\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u4e0d\u786e\u5b9a\u662f\u503c\u7c7b\u578b\u8fd8\u662f\u5f15\u7528\u7c7b\u578b\uff0c\u5c31\u4f7f\u7528\u6cdb\u578b\u7c7b\u578b(T)\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/xwth0h0d(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n<p style=\"border: 0px; margin: 0px 0px 20px; padding: 0px; font-size: 14px; color: rgb(51, 51, 51); font-family: Arial, sans-serif; line-height: 21px; background-color: rgb(255, 255, 255);\">\n\t41. \u5fae\u8f6f\uff08\u5728\u4ee3\u7801\u5206\u6790\u6761\u4f8b\u548c\u6307\u5bfc\u4e2d\uff09\u5e76\u4e0d\u63a8\u8350\u4f7f\u7528&rsquo;out&rsquo;\u548c&rsquo;ref&rsquo;\uff0c\u8fd9\u4e9b\u5173\u952e\u5b57\u662f\u901a\u8fc7\u5f15\u7528\u4f20\u53c2\uff0c\u8bf7\u6ce8\u610f\uff0c&rsquo;ref&rsquo;\u53c2\u6570\u5728\u4f20\u5165\u88ab\u8c03\u7528\u65b9\u6cd5\u4e4b\u524d\uff0c\u5e94\u5f53\u5728\u8c03\u7528\u65b9\u6cd5\u4e2d\u5148\u521d\u59cb\u5316\uff0c\u4f46&rsquo;out&rsquo;\u53c2\u6570\u5c31\u4e0d\u662f\u8fd9\u6837\u3002\u53c2\u8003\uff1a<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms182131(v=vs.100).aspx\" style=\"border: 0px; margin: 0px; padding: 0px; color: rgb(0, 153, 204);\">msdn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9 C# \u5f00\u53d1\u8005\u7684\u4ee3\u7801\u5ba1\u67e5\u6e05\u5355 \u53ef\u53c2\u8003\uff1a 1. \u786e\u4fdd\u6ca1\u6709\u4efb\u4f55\u8b66\u544a\uff08warnings\uff09\u3002 2.\u5982\u679c\u5148\u6267\u884cCode [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[],"class_list":["post-2809","post","type-post","status-publish","format-standard","hentry","category-aspdotnet"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=2809"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2809\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=2809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=2809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=2809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}