本文整理汇总了VB.NET中System.Web.Services.Discovery.DiscoveryClientReferenceCollection类的典型用法代码示例。如果您正苦于以下问题:VB.NET DiscoveryClientReferenceCollection类的具体用法?VB.NET DiscoveryClientReferenceCollection怎么用?VB.NET DiscoveryClientReferenceCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DiscoveryClientReferenceCollection类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: MyDiscoveryClientReferenceCollection
' 导入命名空间
Imports System.Net
Imports System.Collections
Imports System.Security.Permissions
Imports System.Web.Services.Discovery
Class MyDiscoveryClientReferenceCollection
Shared Sub Main()
Run()
End Sub
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Shared Sub Run()
Dim myDiscoveryClientProtocol As New DiscoveryClientProtocol()
myDiscoveryClientProtocol.Credentials = CredentialCache.DefaultCredentials
' 'dataservice.vsdisco' is a sample discovery document.
Dim myStringUrl As String = "http://localhost/dataservice.vsdisco"
' Call the Discover method to populate the References property.
Dim myDiscoveryDocument As DiscoveryDocument = _
myDiscoveryClientProtocol.Discover(myStringUrl)
' Resolve all references found in the discovery document.
myDiscoveryClientProtocol.ResolveAll()
Dim myDiscoveryClientReferenceCollection As DiscoveryClientReferenceCollection = _
myDiscoveryClientProtocol.References
' Retrieve the keys from the collection.
Dim myCollection As ICollection = myDiscoveryClientReferenceCollection.Keys
Dim myObjectCollection(myDiscoveryClientReferenceCollection.Count) As Object
myCollection.CopyTo(myObjectCollection, 0)
Console.WriteLine("The discovery documents, service descriptions, and XML schema")
Console.WriteLine(" definitions in the collection are:")
Dim i As Integer
For i = 0 To myObjectCollection.Length - 1
Console.WriteLine(myObjectCollection(i))
Next i
' Retrieve the values from the collection.
Dim myCollection1 As ICollection = myDiscoveryClientReferenceCollection.Values
Dim myObjectCollection1(myDiscoveryClientReferenceCollection.Count - 1) As Object
myCollection1.CopyTo(myObjectCollection1, 0)
Console.WriteLine("The objects in the collection are:")
For i = 0 To myObjectCollection1.Length - 1
Console.WriteLine(myObjectCollection1(i))
Next i
Dim myStringUrl1 As String = "http://localhost/dataservice.vsdisco"
If myDiscoveryClientReferenceCollection.Contains(myStringUrl1) Then
Console.WriteLine("The document reference {0} is part of the collection.", _
myStringUrl1)
End If
End Sub
End Class
开发者ID:VB.NET开发者,项目名称:System.Web.Services.Discovery,代码行数:62,代码来源:DiscoveryClientReferenceCollection
注:本文中的System.Web.Services.Discovery.DiscoveryClientReferenceCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论