关于当传过来的值转换成string类型报错的问题

有时候直接写 string str=request.param["str"].tostring;会报错,是因为接受到的值可能是空的

这个时候就可以这样写 string _action = string.Format("{0}", Request.QueryString["str"]); 

这样写就不会报错了 

原文地址:https://www.cnblogs.com/superMay/p/5740714.html