我遗漏了一些非常基本的东西,我不知道是什么......我对Linq有例外:
Dim arch As List(Of String)
'gets archive as String() and casts it as List
arch = client.GetArchive().ToList()
'here exception occurs: Cannot cast object of type 'WhereSelectListIterator`2'...
arch = From a In arch
Where a.EndsWith(System.Environment.UserName & ".htm")
Select a
答案 0 :(得分:6)
如其所述,您正在尝试将迭代器存储到列表中。
试试这个:
<div id="container">
<section id="intro">...</section>
<div id="content">...</div>
<aside id="nav">...</aside>
<footer>...</footer>
</div>
我更喜欢扩展程序linq,但它只是偏好,我的工作原因是因为arch = arch.where(Function(x)x.EndsWith(System.Environment.UserName & ".htm")).ToList()
:)