8
Answers

Int32.parse method

tom linker

tom linker

12y
3.8k
1
private void button1_Click(object sender, EventArgs e)
        {          
            long i = Int64.Parse(textBox1.Text);
            MessageBox.Show(i.ToString());
        }
In This code, If we pass the textBox value in interger type, It's return integer value just like
textBox1.text=23 return 23.
But if we enter string type value in textBox, it's fire exception, as like
textBox1.text="Tom".

Why?

 
Answers (8)