本文整理汇总了VB.NET中System.Web.SiteMapNodeCollection.Contains方法的典型用法代码示例。如果您正苦于以下问题:VB.NET SiteMapNodeCollection.Contains方法的具体用法?VB.NET SiteMapNodeCollection.Contains怎么用?VB.NET SiteMapNodeCollection.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.SiteMapNodeCollection
的用法示例。
在下文中一共展示了SiteMapNodeCollection.Contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: Not
Dim providername1 As String = "xAspNetXmlSiteMapProvider"
Dim providername2 As String = "MyXmlSiteMapProvider"
Dim providers As SiteMapProviderCollection = SiteMap.Providers
If Not (providers(providername1) Is Nothing) AndAlso Not (providers(providername2) Is Nothing) Then
Dim provider1 As SiteMapProvider = providers(providername1)
Dim provider2 As SiteMapProvider = providers(providername2)
Dim collection1 As SiteMapNodeCollection = provider1.RootNode.ChildNodes
Dim collection2 As SiteMapNodeCollection = provider2.RootNode.ChildNodes
Dim matches As Integer = 0
Dim node As SiteMapNode
For Each node In collection1
If collection2.Contains(node) Then
Response.Write("Match found at " & _
providername1 & ", index = " & _
collection1.IndexOf(node) & " with " & _
providername2 & ", index = " & _
collection2.IndexOf(node) & ".<br />")
matches += 1
End If
Next node
Response.Write("Number of matches found = " & _
matches.ToString() + ".")
Else
Response.Write(providername1 & " or " & _
providername2 & " not found.")
End If