C#可以创建自己的扩展方法Extension Method: 参考这篇<判断是否为空然后赋值>http://www.cnblogs.com/insus/p/8004097.html 里,前面三个方法,均出现null这关键词,在判断时,你需要== null或者!=null. 其实你完全可以创建C#的扩展方法来消除这种的繁杂. public static class ExtensionMethod { public static bool IsNull(this object obj) { ret…