本文整理汇总了VB.NET中System.Web.Services.Discovery.DiscoveryClientProtocol.DiscoveryClientResultsFile类的典型用法代码示例。如果您正苦于以下问题:VB.NET DiscoveryClientProtocol.DiscoveryClientResultsFile类的具体用法?VB.NET DiscoveryClientProtocol.DiscoveryClientResultsFile怎么用?VB.NET DiscoveryClientProtocol.DiscoveryClientResultsFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DiscoveryClientProtocol.DiscoveryClientResultsFile类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: myDiscoveryClient_Results
' 导入命名空间
Imports System.Web.Services.Discovery
Imports System.Net
Imports System.Xml
Imports System.Xml.Serialization
Class myDiscoveryClient_Results
Shared Sub Main()
Dim outputDirectory As String = "c:\InetPub\wwwroot"
Dim myClient As New DiscoveryClientProtocol()
' Use default credentials to access the URL being discovered.
myClient.Credentials = CredentialCache.DefaultCredentials
Try
Dim myDocument As DiscoveryDocument
' Discover the supplied URL to determine if it is a discovery document.
myDocument = myClient.Discover("http://localhost/MathService_vb.vsdisco")
myClient.ResolveAll()
Dim myCollection As DiscoveryClientResultCollection = _
myClient.WriteAll(outputDirectory, "MyDiscoMap.discomap")
' Get the DiscoveryClientProtocol.DiscoveryClientResultsFile.
Dim myResultFile As New DiscoveryClientProtocol.DiscoveryClientResultsFile()
Dim mySerializer As New XmlSerializer(myResultFile.GetType())
Dim reader = New XmlTextReader("http://localhost/MyDiscoMap.discomap")
myResultFile = CType(mySerializer.Deserialize(reader), _
DiscoveryClientProtocol.DiscoveryClientResultsFile)
' Get a collection of 'DiscoveryClientResult' objects.
Dim myResultcollection As DiscoveryClientResultCollection = _
myResultFile.Results
Console.WriteLine("Referred file(s) : ")
Dim myResult As DiscoveryClientResult
For Each myResult In myResultcollection
Console.WriteLine(myResult.Filename)
Next myResult
Catch e As Exception
Console.WriteLine(e.Message)
End Try
End Sub
End Class
开发者ID:VB.NET开发者,项目名称:System.Web.Services.Discovery,代码行数:42,代码来源:DiscoveryClientProtocol.DiscoveryClientResultsFile