1:Int. Parse (one parameter)
This parameter must satisfy:
1 can only be a string;
2 can only be an "integer" string, which is the form after various integer tostring () , and cannot be a floating-point type.
2:Int. TryParse (parameter A, parameter b);
This method can be considered an int. The Parse () method upgrades, that is, an exception handler, returns False if an exception occurs, and returns the output parameter to 0;
Note that parameter A, also must be a string or null to
For example:
int b;
Int. TryParse ("54.1", out B);
Response.Write (b);
The result is: 0
int b;
Int. TryParse (Null,out b);
Response.Write (b);
The result is: 0
int b=12;
Int. TryParse ("Fdfds", out B);
Response.Write (b);
The result is: 0
int b=12;
Int. TryParse ("123456", out B);
Response.Write (b);
The result is: 123456, not 12
3:convert.toint32 (one parameter)
This parameter can be a variety of types, but this string type "DFADF", "123.1" will error
int b= convert.toint32 (null);
Response.Write (b);
Results: 0
bool A = false;
int b= Convert.ToInt32 (a);
Response.Write (b);
Results: 0
int b= Convert.ToInt32 (1253.1);
Response.Write (b);
Results: 1253
int b= Convert.ToInt32 (1253.5);
Response.Write (b);
Results: 1254
Int. Parse (), Int. The difference between TryParse () and Convert.ToInt32 ()