我試圖讓this sitemap clas工作。VB.NET和LINQ。我在這裏錯過了什麼?
它似乎使用LINQ,我從來沒有用過,但編程的一半樂趣是學習新東西!
我的問題是,我得到LINQ代碼的編譯錯誤。 VS只是不認識它。我有一個參考system.data.linq,我有一個進口system.data.linq,但仍然在代碼讀取,「Dim folders = From o在Directory.GetDirectories ...」,它告訴我「預計結束聲明。」
我在配線這件東西時缺少什麼,以便我可以使用LINQ?我的框架是2.0.5。 LINQ在2中對我來說簡直不可用?如果是這樣,爲什麼我的GAC中的system.data.linq?
下面的代碼:
Private Sub AddFolders(ByVal parentNode As SiteMapNode)
Dim folders = From o In Directory.GetDirectories(HttpContext.Current.Server.MapPath(parentNode.Key)) _
Let dir = New DirectoryInfo(o) _
Where Not Regex.Match(dir.Name, ExcludedFolders).Success _
Select New()
For Each item In folders
Dim folderUrl As String = parentNode.Key + item.DirectoryName
Dim folderNode As New SiteMapNode(Me, folderUrl, Nothing, item.DirectoryName, item.DirectoryName)
AddNode(folderNode, parentNode)
AddFiles(folderNode)
Next
End Sub
感謝你們。堆棧溢出岩石。
Arg。我們仍然在2005年。我每週都會對它們進行竊聽,我們需要升級並被忽略。至少,這對我來說是更多的彈藥。 謝謝你們! – aape 2009-08-26 12:53:48