Session["dxef"]="aa"后,可以string strTmp=Session["dxef"]+""而不可以string strTmp=Session["dxef"]?
我是丁学 2006-07-16 04:22:18 Session["dxef"]="aa";
string strTmp=Session["dxef"]; //A
strTmp=Session["dxef"]+""; //B
strTmp=Convert.ToString(Session["dxef"]); //C
为什么A句会出错,而B、C可以通过?
A提示:无法将类型“object”隐式转换为“string”。存在一个显式转换(是否缺少强制转换?)
C可以理解,可为什么B可以隐式转换,而A不可以呢?