private void Form1_Load(object sender, EventArgs e) { License license = new License(); sql_con.Open(); string cmd = "SELECT Nserie FROM License WHERE ID = '1' "; string cmd1 = "SELECT AutoN FROM License WHERE ID = '1' "; SQLiteCommand sql_cmd = new SQLiteCommand(cmd, sql_con); SQLiteCommand sql_cmd1 = new SQLiteCommand(cmd1, sql_con); string a = sql_cmd.ExecuteScalar().ToString(); string b = sql_cmd1.ExecuteScalar().ToString(); sql_con.Close(); label1.Text = "Licensed to :" + b; string hash = Reverse(FingerPrint.Value()) + "-" + "OFPP-" + "\n" + Resizee(FingerPrint.Value()) + FingerPrint.Value() + "20UU"; MD5 md5Hash = MD5.Create(); string md5 = GetMd5Hash(md5Hash, hash); Debug.WriteLine("aaaa" + a); if (a != md5) { license.ShowDialog(); } else { login.ShowDialog(); } }
public License() { InitializeComponent(); sql_con = new SQLiteConnection ("Data Source=lic.sqlite;Version=3"); label1.Text = FingerPrint.Value(); string hash = Reverse(FingerPrint.Value()) + "-" + "OFPP-" + "\n" + Resizee(FingerPrint.Value()) + label1.Text + "20UU"; MD5 md5Hash = MD5.Create(); md5 = GetMd5Hash(md5Hash, hash); memoEdit1.Text = md5; }