清泛IT社区

标题: 无法将类型“System.Collections.Generic.List<string>”隐式转换为“System.Collections.ArrayList” [打印本页]

作者: 清泛网    时间: 2015-11-25 15:34
标题: 无法将类型“System.Collections.Generic.List<string>”隐式转换为“System.Collections.ArrayList”
  1. List<string> list = new List<string>();
  2. .........
  3. ArrayList al = new ArrayList();
  4. al.AddRange(list);
复制代码
如果单纯转换为对象数组,直接调用 list.ToArray() 方法。




欢迎光临 清泛IT社区 (https://bbs.tsingfun.com/) Powered by Discuz! X3.3