StringBuilder sbEquipment = new StringBuilder();
foreach (ListItem li in chklEquipment.Items)
{
    if (li.Selected)
    {
        sbEquipment.AppendFormat("{0}|", li.Text);
    }
}

if (sbEquipment.Length > 1)
{
    sbEquipment.Remove(sbEquipment.Length - 1, 1);
}

//string strEquipment = String.Empty;
string[] arrEquipment = strEquipment.Split(new char[] { '|' });

foreach (ListItem li in chklEquipment.Items)
{
    foreach (string str in arrEquipment)
    {
        if (li.Text.Equals(str))
        {
            li.Selected = true;
            break;
        }
    }
}

相关文章:

  • 2022-02-28
  • 2021-11-16
  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
猜你喜欢
  • 2021-07-19
  • 2021-09-07
  • 2021-05-23
  • 2021-08-22
  • 2022-01-14
  • 2021-11-16
相关资源
相似解决方案