private string GetSendUserList(int kid, string ulist, ref int sendtype /*, int type, out string reccid*/) { string reccid = ""; string recuserid = ""; bool sendWithClass = true; switch (sendtype) { //发送方式(0按小朋友,1按老师,2按年级,3按班级,4按部门,5按职位) case 1: case 2: recuserid = ulist.Replace('$', ','); break; case 0: string[] personlist = ulist.Split('$'); StringBuilder clslist = new StringBuilder(); StringBuilder userlist = new StringBuilder(); foreach (string per in personlist) { if (per == "" || per.EndsWith("|") == false) { continue; } string[] arr = per.Split('|'); string cid = arr[0]; string isall = arr[1]; int startIndex = cid.Length + 2; string userids = per.Substring(startIndex); if (isall == "1") { clslist.AppendFormat("{0},", cid); } else { sendWithClass = false; userlist.Append(userids.Replace('|', ',')); } } reccid = clslist.ToString(); if (sendWithClass) { recuserid = reccid; sendtype = 3; } else { //1:APP短信,2:平台短信 if (/*type == 2 &&*/ reccid != "") { string uids = UserDataProxy.GetUseridStr(reccid); userlist.Append(uids); } recuserid = userlist.ToString(); } break; default: break; } return(recuserid); }