List<int> list = new List<int>(); list.Add(1); list.Add(2); list.Add(3); Cache["Key"] = list; var list2 = Cache["Key"] as List<int>; List<int> listNew = list2; listNew.Add(4); if (list2 != null && list2.Count > 0) { foreach (int i in list2) { Response.Write(i + "<br/>"); } }结果1234
时间: 2024-10-27 17:37:06