这个小问题我还是第一次遇到,平时不怎么注意(RadioButton的Checked).

博客提到遇到一个关于RadioButton的Checked的小问题,平时对此不太注意。
private void SaveSettings(string filepath) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine(“ECU TYPE”); stringBuilder.AppendLine(this.EcuTypeComboBox.SelectedItem.ToString()); stringBuilder.AppendLine(“TEST 3.2.3/3.2.4”); stringBuilder.AppendLine(this.Test323RadioButton.Checked ? “3.2.3” : “3.2.4”); stringBuilder.AppendLine(“TEST 3.2.8/3.2.9”); stringBuilder.AppendLine(this.Test328RadioButton.Checked ? “3.2.8” : “3.2.9”); stringBuilder.AppendLine(“ECU Type CAN”); stringBuilder.AppendLine(this.TestRadioButtonCAN.Checked ? “CAN” : “CAN-FD”); stringBuilder.AppendLine(“Disturbance HW Type”); stringBuilder.AppendLine(this.HWradioButtonCAN.Checked ? “CAN” : “CAN-FD”); stringBuilder.AppendLine(“REQUEST ID”); stringBuilder.AppendLine(this.RequestIDTextBox.Text); stringBuilder.AppendLine(“RESPONSE ID”); stringBuilder.AppendLine(this.ResponseIDTextBox.Text); stringBuilder.AppendLine(“BROADCAST ID”); stringBuilder.AppendLine(this.BroadcastIDTextBox.Text); stringBuilder.AppendLine(“USE EXTENDED IDS”); stringBuilder.AppendLine(this.UseExtendedIDsCheckBox.Checked.ToString()); stringBuilder.AppendLine(“BOOT TAB PAGE”); stringBuilder.Append(this.SerializeTabPage(this.BootTabPage)); stringBuilder.AppendLine(“APPLICATION STD TAB PAGE”); stringBuilder.Append(this.SerializeTabPage(this.AppStdTabPage)); stringBuilder.AppendLine(“APPLICATION OBD TAB PAGE”); stringBuilder.Append(this.SerializeTabPage(this.AppOBDTabPage)); stringBuilder.AppendLine(“UDS”); stringBuilder.AppendLine(this.UdsSupportedCheckBox.Checked.ToString()); stringBuilder.AppendLine(“HARDENING”); stringBuilder.AppendLine(this.HardeningCheckBox.Checked.ToString()); try { StreamWriter streamWriter = new StreamWriter(filepath); streamWriter.Write(stringBuilder.ToString()); streamWriter.Close(); } catch (Exception ex) { MessageBox.Show("Could not save data. Additional information: " + ex.ToString(), “Error”, MessageBoxButtons.OK, MessageBoxIcon.Hand); } }这部分代码的作用和功能
最新发布
11-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值