private void btnReset_Click(object sender, EventArgs e) { if (File.Exists(CommonStaticVariables.iniFilePath)) { File.Delete(CommonStaticVariables.iniFilePath); } CommonStaticVariables.writeDefaultConfiguration(); CommonStaticVariables.loadDefaultConfiguration(); loadItem(); }
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(); }
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); }
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); } }
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(); }