您的位置:首页 > 其它

随笔

2015-06-05 10:32 183 查看
Hashtable ht2 = new Hashtable();

ht2["aaa"] = "";
ht2["bbb"] = null;
ht2["ccc"] = "11";
if (ht2 != null && !string.IsNullOrEmpty(ht2["bbb"].ToString()))
{
var cc = ":";
}


当ht2["bbb"]=null的时候 tostring 会报错 必须写成 if (ht2 != null &&ht2["bbb"]!=null&& !string.IsNullOrEmpty(ht2["bbb"].ToString()))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: