does not contain a definition for ‘Distinct’@H_403_4@
用这段代码:@H_403_4@
using System.Collections.Generic; //.. . . . . code List<string> Words = new List<string>(); // many strings added here . . . Words = Words.Distinct().ToList();
using System.Linq;
?@H_403_4@
Distinct是在System.Linq.Enumerable中定义的扩展方法,因此您需要添加该using语句.@H_403_4@
并且不要忘记添加对System.Core.dll的引用(如果您使用的是VS2008,这已经为您完成了).@H_403_4@