Does Textbox.Text.GetTypeCode() always return "string"?
Just wondering if the value in the text box was an int, would GetTyp开发者_如何学JAVAeCode return int or string?
Textbox.Text is a String object, therefore it will always returning the TypeCode of a String object ("string" in this case).
Check out String.GetTypeCode for reference.
The value of the Text
property of the textbox is always a string
, doesn't matter if you put a number in there, so it'll always return that it's a string.
Justin is right.
You would have to to a Int32.TryParse to test if the value can be an int.
精彩评论