Пример #1
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     if (File.Exists(CommonStaticVariables.iniFilePath))
     {
         File.Delete(CommonStaticVariables.iniFilePath);
     }
     CommonStaticVariables.writeDefaultConfiguration();
     CommonStaticVariables.loadDefaultConfiguration();
     loadItem();
 }
Пример #2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     IP       = txtBoxIP.Text.Trim();
     Port     = txtBoxPort.Text.Trim();
     HomePath = txtBoxHome.Text.Trim();
     ConfigureHandler.WriteIniData("Configuration", "IP", IP);
     ConfigureHandler.WriteIniData("Configuration", "Port", Port);
     ConfigureHandler.WriteIniData("Configuration", "Home", HomePath);
     CommonStaticVariables.loadConfiguration();
     this.Close();
 }
Пример #3
0
        public MainFrm()
        {
            InitializeComponent();
            tsbRefresh.Enabled = false;
            tsbHalt.Enabled    = false;
            tsbReboot.Enabled  = false;
            // 初始化消息映射表
            CommonStaticVariables.init();
            if (!Directory.Exists(CommonStaticVariables.homePath))
            {
                Directory.CreateDirectory(CommonStaticVariables.homePath);
            }

            ResizeInit(this);
        }
Пример #4
0
 public MainFrm()
 {
     InitializeComponent();
     for (int i = 0; i <= 7; ++i)
     {
         this.contextMenuStrip1.Items[i].Enabled = false;
     }
     notifyIcon1.ContextMenuStrip = this.contextMenuStrip1;
     notifyIcon1.Text             = "杭电快盘";
     notifyIcon1.Visible          = true;
     CommonStaticVariables.init();
     if (!Directory.Exists(CommonStaticVariables.homePath))
     {
         Directory.CreateDirectory(CommonStaticVariables.homePath);
     }
 }
Пример #5
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     IP             = txtBoxIP.Text.Trim();
     Port           = txtBoxPort.Text.Trim();
     MaxClientCount = txtBoxMaxClientCount.Text.Trim();
     DataBase       = txtBoxDataBase.Text.Trim();
     HomePath       = txtBoxHome.Text.Trim();
     ConfigureHandler.WriteIniData("Configuration", "IP", IP);
     ConfigureHandler.WriteIniData("Configuration", "Port", Port);
     ConfigureHandler.WriteIniData("Configuration", "MaxClientCount", MaxClientCount);
     ConfigureHandler.WriteIniData("Configuration", "DataBase", DataBase);
     ConfigureHandler.WriteIniData("Configuration", "Home", HomePath);
     CommonStaticVariables.loadConfiguration();
     MessageBox.Show("配置成功!\n下次启动机器时生效!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     this.Close();
 }