示例#1
0
 private void btnOK_Click(object sender, System.EventArgs e)
 {
     try
     {
         string serial = this.txtSerial1.Text + this.txtSerial2.Text + this.txtSerial3.Text +
                         this.txtSerial4.Text + this.txtSerial5.Text;
         if (serial == RegistrationClass.GetEncryptedKeyFull())
         {
             int roomsCount = RegistrationClass.GetRoomsCount();
             RegistrationClass.StoreKeyToRegistry(serial);
             RegistrationClass.StoreKeyToRegistry("Vlera2", roomsCount.ToString().Length.ToString());
             MessageBox.Show("Rregjistrimi i programit u krye me sukses per " + roomsCount + " dhoma" +
                             Environment.NewLine + "Ju lutemi hapni dhe mbyllni programin perseri qe ndryshimet te "
                             + "te pasqyrohen ne program.", "Rregjistrimi", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
             this.Close();
         }
         else
         {
             MessageBox.Show("Numri serial qe ju futet nuk eshte i sakte. Ju lutemi provoni perseri ose merrni numrin serial nga VisionInfoSolution", "Rregjistrimi", MessageBoxButtons.OK,
                             MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         return;
     }
 }
 private void NumriDhomave_Load(object sender, System.EventArgs e)
 {
     this.initialValue      = RegistrationClass.GetRoomsCount();
     this.numNrDhomash.Text = this.initialValue.ToString();
     // TODO: Merr numrin e dhomave nga regjistri dhe hidhe ne numericBox dhe ne initialValue
 }