獲取的是前臺傳過來的String類型的值,例如:1,123,44,59.net
具體代碼以下blog
if (!string.IsNullOrEmpty(str)) { string[] strArr = str.Split(','); int[] intArr = new int[strArr.Length]; for (int i = 0; i < strArr.Length; i++) { intArr[i] = Convert.ToInt32(strArr[i]); } lists = UsersSer.QueryWhere(c => intArr.Contains(c.ID)); }
參考:http://bbs.csdn.net/topics/390930931string