欢迎来到传世资源网!
加载中...
正在加载,请耐心等待...
本站为收藏、学习站,如有侵权,请联系管理员删除!

winform程序测试加密数据库连接字段+winform调用谷歌浏览器

介绍 评论 失效链接反馈

winform程序测试加密数据库连接字段 winform浏览器(谷歌内核)webkit内核from clipboard
from clipboard from clipboard     public partial class SQLSet : Form
    {
        string iNewLine = System.Environment.NewLine;
        string iDES = "";
        string iFormTilte = "CRRC";
        string iFormGroup = "TV1";
        string iFormConn = "CRRC";

        public SQLSet()
        {
            InitializeComponent();
            iFormTilte = "CRRC";
            iFormGroup = "TV1";
            iFormConn = "CRRC";
        }

        private void BTNTest_Click(object sender, EventArgs e)
        {
            if (XMLCenter.TestConn(txtSQLString.Text))
            {
                MessageBox.Show("数据库连接成功!");
            }
            else
            {
                MessageBox.Show("连接数据库失败!");
            }
            txtDES.Text = EncryptCenter.EncryptDES(txtSQLString.Text, "CRRC2016");
            txtGroup.Text = iFormGroup;
        }

        private void SQLSet_Load(object sender, EventArgs e)
        {
            txtSQLString.Focus();
            iDES = EncryptCenter.EncryptDES(txtSQLString.Text, "CRRC2016");
            List<RefreshInfo> iRInfo = new ReadConfig().Read(ref iFormTilte, ref iFormGroup, ref iFormConn);
            //txtGroup.Text = iFormGroup;
            txtDES.Text = iDES;

        }

        private void BTNUpdate_Click(object sender, EventArgs e)
        {
            if (XMLCenter.TestConn(txtSQLString.Text))
            {
                iFormGroup = "TV1";
                iFormConn = "CRRC";
                iFormTilte = "CRRC";
                iDES = EncryptCenter.EncryptDES(txtSQLString.Text, "CRRC2016");
                txtDES.Text = iDES;
                XMLCenter.Write(iFormTilte, iFormGroup, iDES, "");
                MessageBox.Show("更新成功!");
                Application.Restart();
            }
            else
            {
                MessageBox.Show("更新失败!");

            }
        }

        private void BTNStart_Click(object sender, EventArgs e)
        {

            if (txtSQLString.Text == "M")
            {
                txtSQLString.Text = EncryptCenter.DecryptDES(iFormConn, "CRRC2016");

            }
            else
            {

                txtSQLString.Text = "data source=.;database=MES_HYGDJT;uid=sa;pwd=1234;Connect Timeout=500";

            }
            txtGroup.Text = iFormGroup;

            txtDES.Text = EncryptCenter.EncryptDES(txtSQLString.Text, "CRRC2016");

        }

        private void BTNCreateIE_Click(object sender, EventArgs e)
        {
            XMLCenter.WriteGM(CreateReg(GetIEValue(CBIE.Text)), CBIE.Text ".reg");
            MessageBox.Show("创建成功!");
            Application.Exit();

            //创建注册表文件
        }

        private string GetIEValue(string iIEVer)
        {
            string t = "00001f40";
            switch (iIEVer)
            {
                case "IE9":
                    t = "00002328";
                    return t;
                case "IE10":
                    t = "00002710";
                    return t;
                case "IE11":
                    t = "00002af8";
                    return t;
            }
            return t;
        }

        private string CreateReg(string strIEHEX)
        {

            string t;
            t = "";
            t = "Windows Registry Editor Version 5.00" iNewLine;
            t = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\Main\\FeatureControl\\FEATURE_BROWSER_EMULATION]" iNewLine;
            t = "\"QBrowserCRRC.exe\"=dword:" strIEHEX iNewLine;
            t = "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION]" iNewLine;
            t = "\"QBrowserCRRC.exe\"=dword:" strIEHEX iNewLine;
            return t;
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                //case Keys.F1:
                //    MessageBox.Show(XMLCenter.XMLTemplete("Go").ToString());
                //    return true;

                case Keys.Escape:
                    this.Hide();
                    return true;
            }
            return false;
        }
    }

下载声明:

本站资源均有第三方用户自行上传分享推荐,非本站自制,仅供玩家做交流学习之用!切勿用于商业用途!游戏作品版权归原作者享有,如有版权问题,请附带版权证明至邮件,本平台将应您的要求删除。
相关推荐:

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复