//快速指令-内容 private void textBox_CmdStr_TextChanged(object sender, EventArgs e) { //存储配置 Ini.Write("快速指令", "内容", textBox_CmdStr.Text); }
private void Form1_Load(object sender, EventArgs e) { #region 加载配置 //网络配置 string configStr; configStr = Ini.Read("网络配置", "IP"); if (configStr != "null") { textBox_ServerIP.Text = configStr; } configStr = Ini.Read("网络配置", "Port"); if (configStr != "null") { textBox_ServerPort.Text = configStr; } //心跳配置 configStr = Ini.Read("心跳配置", "周期"); if (configStr != "null") { comboBox_HeartCirle.Text = configStr; } configStr = Ini.Read("心跳配置", "用户ID"); if (configStr != "null") { textBox_UserID.Text = configStr; } configStr = Ini.Read("心跳配置", "设备ID"); if (configStr != "null") { textBox_DeviceId.Text = configStr; } //监听配置 configStr = Ini.Read("监听配置", "开指令"); if (configStr != "null") { textBox_opencmd.Text = configStr; } configStr = Ini.Read("监听配置", "关指令"); if (configStr != "null") { textBox_closecmd.Text = configStr; } //快速指令 configStr = Ini.Read("快速指令", "类型"); if (configStr != "null") { comboBox_CmdType.Text = configStr; } configStr = Ini.Read("快速指令", "设备ID"); if (configStr != "null") { textBox_CmdDeviceID.Text = configStr; } configStr = Ini.Read("快速指令", "内容"); if (configStr != "null") { textBox_CmdStr.Text = configStr; } #endregion }
//快速指令-设备ID private void textBox_CmdDeviceID_TextChanged(object sender, EventArgs e) { //存储配置 Ini.Write("快速指令", "设备ID", textBox_CmdDeviceID.Text); }
//快速指令-类型 private void comboBox_CmdType_SelectedIndexChanged(object sender, EventArgs e) { //存储配置 Ini.Write("快速指令", "类型", comboBox_CmdType.Text); }
//关指令变化 private void textBox_closecmd_TextChanged(object sender, EventArgs e) { //存储配置 Ini.Write("监听配置", "关指令", textBox_closecmd.Text); }
//监听设备ID private void textBox_DeviceId_TextChanged(object sender, EventArgs e) { //存储配置 Ini.Write("监听配置", "设备ID", textBox_DeviceId.Text); }
//用户id变化 private void textBox_UserID_TextChanged(object sender, EventArgs e) { //存储配置 Ini.Write("心跳配置", "用户ID", textBox_UserID.Text); }