Sets the XmlResolver to use for resolving external resources. : XmlResolver « XML « VB.Net






Sets the XmlResolver to use for resolving external resources.

  

Imports System
Imports System.IO
Imports System.Xml
Imports System.Net

public class Sample 

  public shared sub Main()
    Dim resolver as XmlUrlResolver = new XmlUrlResolver()
    resolver.Credentials = CredentialCache.DefaultCredentials

    Dim doc as XmlDocument = new XmlDocument()
    doc.XmlResolver = resolver  ' Set the resolver.
    doc.Load("book5.xml")

    Console.WriteLine(doc.DocumentElement.LastChild.InnerText)

  end sub
end class

   
    
  








Related examples in the same category

1.XmlResolver resolves external XML resources named by a Uniform Resource Identifier (URI).
2.Sets the XmlResolver used for resolving DTD references.