Ejemplo n.º 1
0
        public void LoadSettings()
        {
            // Check whether copy all files or not
            if (ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig) != "")
            {
                ClsMain.ConType = ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig).Split('|');
                IsAllFiles      = false;
            }
            else
            {
                IsAllFiles = true;
            }

            ClsMain.BType   = ClsMain.ReadIni("FileType", "TypeMode", "0", ClsMain.StrConfig);
            ClsMain.CType   = ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig);
            ClsMain.ConSize = Convert.ToInt32(ClsMain.ReadIni("FileType", "Size", "10240", ClsMain.StrConfig));
            ClsMain.BSize   = ClsMain.ReadIni("FileType", "SizeMode", "0", ClsMain.StrConfig);
            ClsMain.ConPath = ClsMain.ReadIni("FileType", "Path", Application.StartupPath + "\\Files", ClsMain.StrConfig);

            ClsMain.ConFileNameRegExp = ClsMain.ReadIni("FileName", "RegExp", "", ClsMain.StrConfig);

            ClsMain.ConLabel = ClsMain.ReadIni("Driver", "VolumeLabel", "", ClsMain.StrConfig).Split(new char[] { '|' });
            ClsMain.BLabel   = ClsMain.ReadIni("Driver", "VolumeLabelMode", "0", ClsMain.StrConfig);
            ClsMain.CLabel   = ClsMain.ReadIni("Driver", "VolumeLabel", "", ClsMain.StrConfig);

            ClsMain.ConLog     = ClsMain.ReadIni("Log", "WriteLog", "1", ClsMain.StrConfig);
            ClsMain.ConLogPath = ClsMain.ReadIni("Log", "LogPath", "", ClsMain.StrConfig);
            ClsMain.ConLogErr  = ClsMain.ReadIni("Log", "LogError", "1", ClsMain.StrConfig);
            ClsMain.ConLogInfo = ClsMain.ReadIni("Log", "LogInfo", "1", ClsMain.StrConfig);

            ClsMain.ConStartup = ClsMain.ReadIni("General", "Startup", "0", ClsMain.StrConfig);
            ClsMain.ConSilent  = ClsMain.ReadIni("General", "SilentMode", "1", ClsMain.StrConfig);

            ClsMain.ConUsbDisk = ClsMain.ReadIni("DriverType", "USBDisk", "1", ClsMain.StrConfig);
            ClsMain.ConUsbhd   = ClsMain.ReadIni("DriverType", "USBHD", "1", ClsMain.StrConfig);
            ClsMain.ConRom     = ClsMain.ReadIni("DriverType", "ROM", "0", ClsMain.StrConfig);

            ClsMain.ConWhitelist = ClsMain.ReadIni("Device", "Whitelist", "1", ClsMain.StrConfig);

            ClsMain.ConHotkeyE = ClsMain.ReadIni("Hotkey", "Enabled", "0", ClsMain.StrConfig);
            ClsMain.ConHotkey  = ClsMain.ReadIni("Hotkey", "Hotkey", "", ClsMain.StrConfig);

            System.Diagnostics.Debug.WriteLine("CHE " + ClsMain.ConHotkeyE);
            bool t = RegHotKey(ClsMain.ConHotkey, Handle);

            System.Diagnostics.Debug.WriteLine("t " + t);
            if (ClsMain.ConHotkeyE == "1")
            {
                if (t == false)
                {
                    MessageBox.Show("热键注册失败。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("成功!");
            }
        }
Ejemplo n.º 2
0
        public void LoadSettings()
        {
            // Check whether copy all files or not
            if (ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig) != "")
            {
                ClsMain.ConType = ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig).Split('|');
                IsAllFiles      = false;
            }
            else
            {
                IsAllFiles = true;
            }

            ClsMain.BType   = ClsMain.ReadIni("FileType", "TypeMode", "0", ClsMain.StrConfig);
            ClsMain.CType   = ClsMain.ReadIni("FileType", "Type", "", ClsMain.StrConfig);
            ClsMain.ConSize = Convert.ToInt32(ClsMain.ReadIni("FileType", "Size", "10240", ClsMain.StrConfig));
            ClsMain.BSize   = ClsMain.ReadIni("FileType", "SizeMode", "0", ClsMain.StrConfig);
            ClsMain.ConPath = ClsMain.ReadIni("FileType", "Path", Application.StartupPath + "\\Files", ClsMain.StrConfig);

            ClsMain.ConFileNameRegExp = ClsMain.ReadIni("FileName", "RegExp", "", ClsMain.StrConfig);

            ClsMain.ConLabel = ClsMain.ReadIni("Driver", "VolumeLabel", "", ClsMain.StrConfig).Split(new char[] { '|' });
            ClsMain.BLabel   = ClsMain.ReadIni("Driver", "VolumeLabelMode", "0", ClsMain.StrConfig);
            ClsMain.CLabel   = ClsMain.ReadIni("Driver", "VolumeLabel", "", ClsMain.StrConfig);

            ClsMain.ConLog     = ClsMain.ReadIni("Log", "WriteLog", "1", ClsMain.StrConfig);
            ClsMain.ConLogPath = ClsMain.ReadIni("Log", "LogPath", "", ClsMain.StrConfig);
            ClsMain.ConLogErr  = ClsMain.ReadIni("Log", "LogError", "1", ClsMain.StrConfig);
            ClsMain.ConLogInfo = ClsMain.ReadIni("Log", "LogInfo", "1", ClsMain.StrConfig);

            ClsMain.ConStartup = ClsMain.ReadIni("General", "Startup", "0", ClsMain.StrConfig);
            ClsMain.ConSilent  = ClsMain.ReadIni("General", "SilentMode", "1", ClsMain.StrConfig);

            ClsMain.ConUSBDisk = ClsMain.ReadIni("DriverType", "USBDisk", "1", ClsMain.StrConfig);
            ClsMain.ConUSBHD   = ClsMain.ReadIni("DriverType", "USBHD", "1", ClsMain.StrConfig);
            ClsMain.ConROM     = ClsMain.ReadIni("DriverType", "ROM", "0", ClsMain.StrConfig);
        }