private void getInitFile() { IniFileClass p = new IniFileClass(".\\para.ini"); cbGPIOPin.SelectedIndex = int.Parse(p.IniReadValue("page1", "cbGPIOPin", "0")); cbGPIOMode.SelectedIndex = int.Parse(p.IniReadValue("page1", "cbGPIOMode", "0")); cbTimerID.SelectedIndex = int.Parse(p.IniReadValue("page1", "cbTimerID", "0")); comboBoxPWMPin.SelectedIndex = int.Parse(p.IniReadValue("page1", "comboBoxPWMPin", "0")); comboBoxADCPin.SelectedIndex = int.Parse(p.IniReadValue("page1", "comboBoxADCPin", "0")); textBoxPeriod.Text = p.IniReadValue("page1", "textBoxPeriod", "1000"); textBoxFreq.Text = p.IniReadValue("page1", "textBoxFreq", "10000"); textBoxDuty.Text = p.IniReadValue("page1", "textBoxDuty", "50"); textBoxSSID.Text = p.IniReadValue("page2", "textBoxSSID", "WiFiMCU_Wireless"); textBoxPSW.Text = p.IniReadValue("page2", "textBoxPSW", ""); textBoxIP.Text = p.IniReadValue("page2", "textBoxIP", "11.11.11.2"); textBoxPort.Text = p.IniReadValue("page2", "textBoxPort", "9000"); textBoxBindLoadPort.Text = p.IniReadValue("page2", "textBoxBindLoadPort", "8000"); textBoxSendData.Text = p.IniReadValue("page2", "textBoxSendData", "Test Data"); comboBoxSerialPort.Text = p.IniReadValue("page0", "comboBoxSerialPort", ""); comboBoxSerialBaudrate.Text = p.IniReadValue("page0", "comboBoxSerialBaudrate", "115200"); }
private void saveInitFile() { IniFileClass p = new IniFileClass(".\\para.ini"); p.IniWriteValue("page1", "cbGPIOPin", cbGPIOPin.SelectedIndex.ToString()); p.IniWriteValue("page1", "cbGPIOMode", cbGPIOMode.SelectedIndex.ToString()); p.IniWriteValue("page1", "cbTimerID", cbTimerID.SelectedIndex.ToString()); p.IniWriteValue("page1", "comboBoxPWMPin", comboBoxPWMPin.SelectedIndex.ToString()); p.IniWriteValue("page1", "comboBoxADCPin", comboBoxADCPin.SelectedIndex.ToString()); p.IniWriteValue("page1", "textBoxPeriod", textBoxPeriod.Text); p.IniWriteValue("page1", "textBoxFreq", textBoxFreq.Text); p.IniWriteValue("page1", "textBoxDuty", textBoxDuty.Text); p.IniWriteValue("page2", "textBoxSSID", textBoxSSID.Text); p.IniWriteValue("page2", "textBoxPSW", textBoxPSW.Text); p.IniWriteValue("page2", "textBoxIP", textBoxIP.Text); p.IniWriteValue("page2", "textBoxPort", textBoxPort.Text); p.IniWriteValue("page2", "textBoxBindLoadPort", textBoxBindLoadPort.Text); p.IniWriteValue("page2", "textBoxSendData", textBoxSendData.Text); p.IniWriteValue("page0", "comboBoxSerialPort", comboBoxSerialPort.Text); p.IniWriteValue("page0", "comboBoxSerialBaudrate", comboBoxSerialBaudrate.Text); }