//********************************************************************************
        //Name : RegistrySetSetting
        //Descriptiopn :

        ///At first delete old registry
        /// If premium version is true then sEtregistry method call and Set key in registry.
        /// Full or Trail Version Set  in registry
        //***************************************************************************************
        private void RegistrySetSetting()
        {
            #region Delete Registry
            try
            {
                Registry.CurrentUser.DeleteSubKeyTree(@"Software\InstallNode");
            }
            catch (Exception) { }
            #endregion

            if (_IsSuccess == true)
            {
                //***********only for Full version set registry**************
                if (mPremiumStatus == "True")
                {
                    SetRegistryKey();
                }
                //
                //**************Full or Trail Version Set***********************
                if (!RegEdit.CreateSubKeyPremium(mPremiumStatus))
                {
                    MessageBox.Show("Premium value not set Form:Software Activation");
                }
            }
        }
        private void TrailAlradyExistCheck()
        {
            string    msg   = "";
            string    query = "Select CurrentDate,EndDate from ApplicationInfo";
            DataTable dt    = SQLHelper.GetInstance().ExcuteNonQuery(query, out msg);

            if (RegEdit.ReadSubkeyAppsPremiumValue() != null || dt.IsValidDataTable())
            {
                linkLabel1.Enabled   = false;
                lblErrorMessege.Text = "You have already used\n DAPRO trial version on this system";
            }
            else
            {
                lblErrorMessege.Text = "";
                linkLabel1.Enabled   = true;
            }
        }
 private void btnNext_Click(object sender, EventArgs e)
 {
     if (_IsSuccess == true)
     {
         if (RegEdit.CreateSubKeyMachineValue(mMachineValue))
         {
             //Desktop notification
             DesktopNotify("Product Activation Successfull", ToolTipIcon.Info);
             //Next Restart Application
             Application.Restart();
         }
         else
         {
             MessageBox.Show("Machine value not set Form:Software Activation");
         }
     }
 }
示例#4
0
        public static bool SetRegistryKey(string skey)
        {
            if (IsValidLisenceKey(skey))
            {
                RegistryKey key = Registry.CurrentUser.OpenSubKey("Software", true);

                if (key != null)
                {
                    RegEdit.CreateSubKey("InstallNode");
                    key = key.OpenSubKey("InstallNode", true);
                    key.CreateSubKey("Ver32");
                    key = key.OpenSubKey("Ver32", true);
                    string encrptKey = CryptorEngine.Encrypt(skey, true);
                    key.SetValue("RunDll", encrptKey);

                    return(true);
                }
            }
            return(false);
        }