AXzhz

专注ASP.NET!
        写软件的都是小姐,用软件的都是大爷。真TMD说的正确!
                嫖妓不给钱,反说被强奸!___中国共享软件的无奈!
读小学的时候大学不要钱,读大学了小学不要钱。
没工作时国家有分福利房,工作了后全是高价房!!

                        此软件能有效的破解QQ密码。(注:破解QQ密码是违法行为,请不要将软件用于违法行为)
“安得广厦千万间,大庇天下寒士俱欢颜,风雨不动安如山。”1200多年前,诗人杜甫的理想,如今被一帮享受着电脑和互联网带来的快捷生活方式的受过高等教育的大孩子憧憬着。

导航

.NET(C#)代码性能优化_AX

①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.
【待续】

博客园斧头帮少帮主

posted on 2007-06-29 11:36  斧头帮少帮主  阅读(2984)  评论(2编辑  收藏  举报

Google
 
站内搜索:        
园内搜索:
金山词霸: