ArrayList sSRecruitId = new ArrayList(); foreach (GridViewRow row in GVSRecruitPlan.Rows) { if (((CheckBox)row.FindControl("CB")).Checked)//CB是checkbox的id { sSRecruitId.Add(GVSRecruitPlan.DataKeys[row.RowIndex].Value.ToString()); } }