後端
protected void lb_orgSD_TextChanged(object sender, EventArgs e)
{
string tmpStr = "";
StringBuilder sb = new StringBuilder();
foreach (int i in lb_orgSD.GetSelectedIndices())
{
sb.AppendFormat("{0}{1}", tmpStr, lb_orgSD.Items[i].Value);
tmpStr = ",";
}
}
PS.
1.GetSelectedIndices() =>以遞增方式排序取值
2.StringBuilder =>長字串,需using System.Text;
沒有留言:
張貼留言