Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Restoredirectory = INIOperationClass.INIGetStringValue(Application.StartupPath + "/setting.ini", "Restoredirectory", "directory", "");

            textBox1.Text = Restoredirectory;

            Backupdirectory = INIOperationClass.INIGetStringValue(Application.StartupPath + "/setting.ini", "Backupdirectory", "directory", "");;

            textBox2.Text = Backupdirectory;
        }
Esempio n. 2
0
        // Token: 0x060002F2 RID: 754 RVA: 0x0001EB88 File Offset: 0x0001CD88
        private void manualBackupBtn_Click(object sender, EventArgs e)
        {
            string text = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "path", "");

            if (text == "")
            {
                this.saveFileWithDialog(text);
                return;
            }
            this.saveFile(text, true);
        }
Esempio n. 3
0
        private void ZOneMain_Load(object sender, EventArgs e)
        {
            comboBoxPort.Text  = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "com", "COM1");
            comboBaudRate.Text = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "baud", "115200");

            comboBoxDataBits.Text = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "Bits", "8");
            comboBoxParity.Text   = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "Parity", "None");
            comboBoxStopBits.Text = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "StopBits", "1");

            textBoxTimeout.Text = INIOperationClass.INIGetStringValue(iniFilePath, "Config", "Timeout", "2");
        }
Esempio n. 4
0
        /// <summary>
        /// 得到连接字符串
        /// </summary>
        /// <returns>连接字符串</returns>
        private static string getConnectionSql()
        {
            string ConfigFile        = System.IO.Directory.GetCurrentDirectory() + "\\Config.ini";
            string connectionSql     = "";
            string P_str_Server      = INIOperationClass.INIGetStringValue(ConfigFile, "SqlServer", "IP", null);     //服务器
            string P_str_DataBase    = INIOperationClass.INIGetStringValue(ConfigFile, "SqlServer", "DBNAME", null); //数据库名称
            string P_str_uid         = INIOperationClass.INIGetStringValue(ConfigFile, "SqlServer", "USER", null);   //用户
            string P_str_pwd_Encrypt = INIOperationClass.INIGetStringValue(ConfigFile, "SqlServer", "PWD", null);    //密码
            string P_str_pwd         = EncAndDec.MD5Decrypt(P_str_pwd_Encrypt);                                      //解密

            connectionSql = "Server=" + P_str_Server + ";DataBase=" + P_str_DataBase + ";User ID=" + P_str_uid + ";Password="******";Persist Security Info=True;  ";
            return(connectionSql);
        }
Esempio n. 5
0
        // Token: 0x060002F7 RID: 759 RVA: 0x0001ED14 File Offset: 0x0001CF14
        private void restoreDbBtn_Click(object sender, EventArgs e)
        {
            string initialDirectory = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "path", "");

            this.openFileDialog1.InitialDirectory = initialDirectory;
            this.openFileDialog1.Filter           = "All files (*.*)|*.*|数据库备份文件 (*.db)|*.db";
            this.openFileDialog1.FilterIndex      = 2;
            this.openFileDialog1.RestoreDirectory = true;
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string file = this.openFileDialog1.FileName.ToString();
                this.restoreFile(file, true);
                //LoginForm.initDB();
            }
        }
Esempio n. 6
0
        // ConfigurationManager.ConnectionStrings["ConnectionStrings"].ConnectionString;
        #endregion

        #region getConnectionSql 得到连接字符串
        /// <summary>
        /// 得到连接字符串
        /// </summary>
        /// <returns>连接字符串</returns>
        ///
        static private string getConnectionSql()
        {
            string ConfigFile = System.IO.Directory.GetCurrentDirectory() + "\\Config.ini";

            string P_str_UserId           = INIOperationClass.INIGetStringValue(ConfigFile, "Oracle", "USER", null); //用户
            string P_str_Password_Encrypt = INIOperationClass.INIGetStringValue(ConfigFile, "Oracle", "PWD", null);  //密码
            string P_str_pwd          = EncAndDec.MD5Decrypt(P_str_Password_Encrypt);                                //解密
            string P_str_HOST         = INIOperationClass.INIGetStringValue(ConfigFile, "Oracle", "IP", null);       //服务器IP
            string P_str_PORT         = INIOperationClass.INIGetStringValue(ConfigFile, "Oracle", "PORT", null);     //端口
            string P_str_SERVICE_NAME = INIOperationClass.INIGetStringValue(ConfigFile, "Oracle", "SID", null);

            string ConnectionStrings = "User Id=" + P_str_UserId.Trim() + ";Password="******";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + P_str_HOST.Trim()
                                       + ")(PORT=" + P_str_PORT.Trim() + ")))(CONNECT_DATA=(SERVICE_NAME=" + P_str_SERVICE_NAME.Trim() + ")))";

            return(ConnectionStrings);
        }
Esempio n. 7
0
        // Token: 0x060001F9 RID: 505 RVA: 0x0000AB00 File Offset: 0x00008D00
        private void saveFile()
        {
            string text = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "path", "");

            if (text == "")
            {
                SaveFileDialog saveFileDialog = new SaveFileDialog();
                saveFileDialog.Filter           = "数据库备份文件(*.db)|*.db";
                saveFileDialog.FilterIndex      = 1;
                saveFileDialog.RestoreDirectory = true;
                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    string text2 = saveFileDialog.FileName.ToString();
                    INIOperationClass.INIWriteValue(".\\wm.ini", "DBBackup", "path", text2);
                    this.saveFile(text2, true);
                    return;
                }
            }
            else
            {
                this.saveFile(text, true);
            }
        }
Esempio n. 8
0
        // Token: 0x060002F0 RID: 752 RVA: 0x0001EAE4 File Offset: 0x0001CCE4
        private void initRadioBtns()
        {
            string str = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "backupType", "0");
            int    num = ConvertUtils.ToInt32(str);

            if (num > 2)
            {
                return;
            }
            switch (num)
            {
            default:
                this.radioButton1.Checked = true;
                return;

            case 1:
                this.radioButton2.Checked = true;
                return;

            case 2:
                this.radioButton3.Checked = true;
                return;
            }
        }
Esempio n. 9
0
        // Token: 0x060002F5 RID: 757 RVA: 0x0001EC30 File Offset: 0x0001CE30
        private void changePathBtn_Click(object sender, EventArgs e)
        {
            string dir = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "path", "");

            this.saveFileWithDialog(dir);
        }
Esempio n. 10
0
        // Token: 0x060002F1 RID: 753 RVA: 0x0001EB54 File Offset: 0x0001CD54
        private void initPathTB()
        {
            string text = INIOperationClass.INIGetStringValue(".\\wm.ini", "DBBackup", "path", "");

            this.filePathTB.Text = text;
        }