本文整理汇总了VB.NET中System.Xml.XmlValidatingReader.XmlResolver属性的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlValidatingReader.XmlResolver属性的具体用法?VB.NET XmlValidatingReader.XmlResolver怎么用?VB.NET XmlValidatingReader.XmlResolver使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了XmlValidatingReader.XmlResolver属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: XmlTextReader
' Create the reader.
Dim txtreader as XmlTextReader = new XmlTextReader("book5.xml")
Dim reader as XmlValidatingReader = new XmlValidatingReader(txtreader)
txtreader.WhitespaceHandling = WhitespaceHandling.None
' Set the credentials necessary to access the DTD file stored on the network.
Dim resolver as XmlUrlResolver = new XmlUrlResolver()
resolver.Credentials = System.Net.CredentialCache.DefaultCredentials
reader.XmlResolver = resolver
' Display each of the element nodes.
while (reader.Read())
select case reader.NodeType
case XmlNodeType.Element:
Console.Write("<{0}>", reader.Name)
case XmlNodeType.Text:
Console.Write(reader.Value)
case XmlNodeType.DocumentType:
Console.Write("<!DOCTYPE {0} [{1}]", reader.Name, reader.Value)
case XmlNodeType.EntityReference:
Console.Write(reader.Name)
case XmlNodeType.EndElement:
Console.Write("</{0}>", reader.Name)
end select
end while