Beispiel #1
0
        public static bool CheckSoftwareRegister()
        {
            Util.HOST_CODE     = clsLxms.getCpu() + clsLxms.GetDiskVolumeSerialNumber();
            Util.REGISTER_CODE = Util.Encrypt(Util.HOST_CODE, Util.PWD_MASK);
            Util.SOFT_REGISTER = false;
            RWReg  reg      = new RWReg("CURRENT_USER");
            string regvalue = reg.GetRegValue(@"software\HBERP", Util.HOST_CODE, string.Empty);

            if (!string.IsNullOrEmpty(regvalue))
            {
                if (Util.REGISTER_CODE.CompareTo(regvalue) == 0)
                {
                    Util.SOFT_REGISTER = true;
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        private void toolSaveAs_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                SaveFileDialog sfd = new SaveFileDialog();
                RWReg          reg = new RWReg("CURRENT_USER");
                sfd.InitialDirectory = reg.GetRegValue(@"\software\microsoft\windows\currentversion\explorer\shell folders", "Desktop", string.Empty);
                sfd.FileName         = this.ImageLocation.Substring(this.ImageLocation.LastIndexOf("\\") + 1);
                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    if (File.Exists(sfd.FileName))
                    {
                        //if (MessageBox.Show(clsTranslate.TranslateString("This file is exist,do you want to override it?"), clsTranslate.TranslateString("Information"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return;

                        File.Delete(sfd.FileName);
                    }
                    File.Copy(this.ImageLocation, sfd.FileName);
                    MessageBox.Show(clsTranslate.TranslateString("File save success!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Beispiel #3
0
        private void btnShow3_Click(object sender, EventArgs e)
        {
            RWReg reg = new RWReg("CURRENT_USER");
            bool  ret = reg.DelRegKeyValue(@"Software\Microsoft\Office\14.0\Excel\Security", "ExtensionHardening");

            if (ret)
            {
                MessageBox.Show("Changed to show the information!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Fail to show the information!", clsTranslate.TranslateString("Failure"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #4
0
        private void btnRemoveExcelInfo_Click(object sender, EventArgs e)
        {
            RWReg reg = new RWReg("CURRENT_USER");
            bool  ret = reg.SetRegValue(@"Software\Microsoft\Office\14.0\Excel\Security", "ExtensionHardening", "00000000", "DWORD");

            if (ret)
            {
                MessageBox.Show("Success to remove the information!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("Fail to remove the information!", clsTranslate.TranslateString("Failure"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #5
0
        private void frmLogin_Load(object sender, EventArgs e)
        {
            clsTranslate.InitLanguage(this);
            FillControl.FillPeriodList(cboPeriodList);
            frmMain.bLogined = false;
            timer1_Tick(null, null);
            timer1.Enabled = true;
            //string strHostName = Dns.GetHostName();
            string strHostName = Environment.MachineName;

            if (strHostName.ToUpper() == "KAIFA0007" || strHostName.ToUpper() == "LUCJ" || strHostName.ToUpper() == "QUWEIQIN")
            {
                //if (strHostName.ToUpper() == "30-0001-14544")
                //    pictureBox1.Visible = false;
                txtUserId.Text = "SYSADMIN";
                txtPwd.Text    = "PPT123";
                txtPwd.Focus();
            }
            else
            {
                txtUserId.Text = ini.IniReadValue("login", "userid");
                if (string.IsNullOrEmpty(txtUserId.Text.Trim()))
                {
                    txtUserId.Focus();
                }
                else
                {
                    txtPwd.Focus();
                }
            }
            RWReg reg = new RWReg("LOCAL_MACHINE");
            bool  ret = reg.SetRegValue(@"SOFTWARE\ORACLE", "NLS_LANG", "SIMPLIFIED CHINESE_CHINA.ZHS16GBK", "STRING");

            dalUserList bll = new dalUserList();

            if (!bll.UpdateDatabaseObject(Application.StartupPath, out Util.emsg))
            {
                MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }