XmlResolver resolves external XML resources named by a Uniform Resource Identifier (URI).
Imports System
Imports System.Xml
Imports System.IO
Module Module1
Sub Main()
Dim resolver As New XmlUrlResolver()
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim baseUri As New Uri("http://serverName/")
Dim fulluri As Uri = resolver.ResolveUri(baseUri, "fileName.xml")
Dim s As Stream = CType(resolver.GetEntity(fulluri, Nothing, GetType(Stream)), Stream)
Dim reader As XmlReader = XmlReader.Create(s)
While reader.Read()
Console.WriteLine(reader.ReadOuterXml())
End While
End Sub
End Module
Related examples in the same category