Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
How to Validate Activation Key and proceed to Login Form
puneet ahooja
Dec 7 2015 5:31 AM
401
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Display bulk of records as table format in Crystal Report
Accessing HttpContext.Current.User property