Example #1
0
        private void registerSoftwareToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MessageBox.Show(Properties.Settings.Default["isActivated"].ToString());
            InsertKey ik = new InsertKey();

            ik.button1.Visible = true;
            ik.ShowDialog();
        }
Example #2
0
        private void trialVersionSecurity()
        {
            //security
            if (Properties.Settings.Default["isActivated"].Equals("False"))//isActivated
            {
                sqlconnect = new SqlConnection(c);
                sqlcmd     = new SqlCommand("insert into Log(id) values (1)", sqlconnect);
                sqlconnect.Open();
                sqlcmd.ExecuteNonQuery();
                sqlconnect.Close();

                sqlconnect = new SqlConnection(c);
                sqlcmd     = new SqlCommand("select * from Log", sqlconnect);
                sqlda      = new SqlDataAdapter(sqlcmd.CommandText, sqlconnect);
                sqlds      = new DataSet();
                sqlda.Fill(sqlds, "login");

                int count = Convert.ToInt32(sqlds.Tables["login"].Rows.Count);
                if (count > 300)
                {
                    InsertKey ik = new InsertKey();
                    ik.ShowDialog();
                    this.Hide();
                }
                else
                {
                    frmMain mainform = new frmMain();
                    mainform.Show();
                    this.Hide();
                }
            }
            else //isActivated
            {
                frmMain mainform = new frmMain();
                mainform.Show();
                this.Hide();
            }
        }