winformcheckbox状态保存 winformcheckbox状态保存
foreach (CheckBox ch in Controls.OfType<CheckBox>()) { string s = ch.Name; bool b = ch.Checked; //将以上存入数据库 }