string text = test1.Text; int i = int.Parse(text); Console.WriteLine(i); int j = 0; if (int.TryParse(text, out j)) { Console.WriteLine(j); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)