■■■惊天秘密!
用下面的代码:
int postID = Convert.ToInt32( null );
Response.Write( postID );
输出的是0
用下面的代码:
int postID = Convert.ToInt32( "");
Response.Write( postID );
会抱错
也就是Convert.ToInt32将null解析为0,而不能解析空字符串
要是我不告诉你们,你们还不知道吧,哈哈
int postID = Convert.ToInt32( null );
Response.Write( postID );
输出的是0
用下面的代码:
int postID = Convert.ToInt32( "");
Response.Write( postID );
会抱错
也就是Convert.ToInt32将null解析为0,而不能解析空字符串
要是我不告诉你们,你们还不知道吧,哈哈
...全文


