本文整理汇总了VB.NET中System.Web.Services.Discovery.DiscoveryClientDocumentCollection类的典型用法代码示例。如果您正苦于以下问题:VB.NET DiscoveryClientDocumentCollection类的具体用法?VB.NET DiscoveryClientDocumentCollection怎么用?VB.NET DiscoveryClientDocumentCollection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DiscoveryClientDocumentCollection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: DiscoveryClientDocumentCollectionSample
' 导入命名空间
Imports System.Net
Imports System.IO
Imports System.Collections
Imports System.Security.Permissions
Imports System.Web.Services.Discovery
Class DiscoveryClientDocumentCollectionSample
Shared Sub Main()
Run()
End Sub
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Shared Sub Run()
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
' 'dataservice.disco' is a sample discovery document.
Dim myStringUrl As String = "http://localhost/dataservice.disco"
' 'Discover' method is called to populate the 'Documents' property.
Dim myDiscoveryDocument As DiscoveryDocument = myDiscoveryClientProtocol.Discover(myStringUrl)
' An instance of the 'DiscoveryClientDocumentCollection' class is created.
Dim myDiscoveryClientDocumentCollection As DiscoveryClientDocumentCollection = _
myDiscoveryClientProtocol.Documents
' 'Keys' in the collection are retrieved.
Dim myCollection As ICollection = myDiscoveryClientDocumentCollection.Keys
Dim myObjectCollection(myDiscoveryClientDocumentCollection.Count-1) As Object
myCollection.CopyTo(myObjectCollection, 0)
Console.WriteLine("The discovery documents in the collection are :")
Dim iIndex As Integer
For iIndex = 0 To myObjectCollection.Length - 1
Console.WriteLine(myObjectCollection(iIndex))
Next iIndex
Console.WriteLine("")
' 'Values' in the collection are retrieved.
Dim myCollection1 As ICollection = myDiscoveryClientDocumentCollection.Values
Dim myObjectCollection1(myDiscoveryClientDocumentCollection.Count-1) As Object
myCollection1.CopyTo(myObjectCollection1, 0)
Console.WriteLine("The objects in the collection are :")
For iIndex = 0 To myObjectCollection1.Length - 1
Console.WriteLine(myObjectCollection1(iIndex))
Next iIndex
End Sub
End Class