开发者

Does Textbox.Text.GetTypeCode() always return "string"?

开发者 https://www.devze.com 2023-01-01 13:17 出处:网络
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 St

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消