Convert.ToInt32 (double value) if value is a floating-point type, rounding is used;
int (4.6) = 4,int conversion Other numeric type is int without rounding, casting (intercepting integer part);
Int. TryParse () is actually a pair of int. Parse () Does an exception handling, returns False if an exception occurs, and returns the output parameter to 0;
Convert.ToInt32 () and Int. Parse () can only be an integer string type (that is, the form after various integer tostring (), cannot be a float, or int. Parse () will present an incorrect string format error for the input eg:int i=convert.toint32 ("4.56");
Int. Parse (String sparameter) is a constructor, and parameter types only support string types;
For null (NULL) processing, CONVERT.TOINT32 (NULL) returns 0 without generating any exceptions, but int. Parse (NULL) produces an exception.
C # integers three coercion types convert int, convert.toint32 (), Int. The difference between the Parse ()