惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
D
DataBreaches.Net
U
Unit 42
P
Proofpoint News Feed
I
InfoQ
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
博客园 - Franky
博客园_首页
IT之家
IT之家
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志

博客园 - 斧头帮少帮主

猜一猜,会输出什么? ASP.NET错误处理的两种方案_AX Log4Net最简单的使用配置_AX 一个修改后的JS日历(Calendar)控件_AX - 斧头帮少帮主 - 博客园 页面回传(PostBack)后恢复滚动条的位置_AX - 斧头帮少帮主 - 博客园 Hidden Field 的值不能回传(PostBack)到后台_AX Delegate(代理)异常:该委托必须有一个目标 WCF学习随笔6--Version变更--我们在前进_AX WCF学习随笔5--我知道:Known--可憐的孩子_AX WCF学习随笔4--契约|序列化详解--祭斧_AX WCF学习随笔3--第一个Sample--祭斧_AX - 斧头帮少帮主 - 博客园 WCF学习随笔2--Contract--磨斧_AX WCF学习随笔1--扫盲--磨斧_AX 把项目运行情况写入系统日志(Log)的三种方法【续】_AX 把项目运行情况写入系统日志(Log)的三种方法_AX 为用户控件User Control添加事件_AX XML常用操作总结_AX DataTable常用操作总结_AX - 斧头帮少帮主 - 博客园 Panel的不足及弥补_AX - 斧头帮少帮主 - 博客园
.NET(C#)代码性能优化_AX - 斧头帮少帮主 - 博客园
斧头帮少帮主 · 2007-06-29 · via 博客园 - 斧头帮少帮主

①string ax=string.Empty;     
注:不要使用: string ax="";  I don't konw why.But it's Microsoft's convention.
判断ax是否为空:
ax.Length==0   >  ax==string.Empty
    Info         : "To test for empty strings, check if String.Length is
                   equal to zero. Constructs such as "".Equals(someString)
                   and String.Empty.Equals(someString) are less efficient
                   than testing the string length. Replace these with
                   checks for someString.Length == 0."

2007-7-13 13:51:10
②Catch{}要捕获详细异常,不要再乱抛
catch the specific exception than "System.Exception" or rethrow the exception.
Catching generic exception types can hide run-time problems from the library user,
and can complicate debugging.

③比较字符串时不要用.ToLower()   /   .ToUpper()
replace by Equals()     
Don't create a string never used later.
【待续】

博客园斧头帮少帮主