Hi Friends,
i want to know how to validate the activation key and proceed to Next form i.e. Login Form.
I am developing the forms.
Can Anyone helps;
Here is the code:
private void button1_Click(object sender, EventArgs e)
{
try
{
if (Convert.ToInt32(textBox1.Text) + Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text) + Convert.ToInt32(textBox4.Text) + Convert.ToInt32(textBox5.Text) == 1000)
MessageBox.Show(" Key Sucessfully Activated!");
login obj = new login();
obj.Show();
this.Hide();
else
MessageBox.Show("Enter Correct Key Number ");
}
catch (System.FormatException ex)
{
MessageBox.Show("Error! Activation Key contain Numbers");
}
}
HERE IS THE ERRORS :
Error 1 Only assignment, call, increment, decrement, and new object expressions can be used as a statement D:\VS Projects\AMC\amc\amc\LicenceKey.cs 35 32 amc
Error 2 Invalid expression term 'else' D:\VS Projects\AMC\amc\amc\LicenceKey.cs 39 17 amc
Error 3 ; expected D:\VS Projects\AMC\amc\amc\LicenceKey.cs 39 21 amc
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
puneet ahoojaPosted Dec 7, 2015, 6:44 AM
Manas MohapatraPosted Dec 7, 2015, 5:59 AM
Sanjay SabariyaPosted Dec 7, 2015, 5:57 AM