I have this code from an example on the MSDN site:
Dim rdr As New XmlTextReader("http://localhost/bookstore/book.xml")
rdr.XmlResolver.Credentials = CredentialCache.DefaultCredentials
Dim doc As New XmlDocument
doc.Load(rdr)
However, I get an error under rdr.XmlResolver, saying that it is Write Only.
I have imported the appropriate namespaces (Net, Xml, Xml.Schema), yet it
says the code isn't valid.
I also had similar problems using
XmlValidatingReader.XmlResolver.Credentials (complaining that it is
Write-only).
Does anyone know why?
Martin Honnen - 04 Jul 2006 16:48 GMT
> I have this code from an example on the MSDN site:
>
[quoted text clipped - 4 lines]
>
> However, I get an error under rdr.XmlResolver, saying that it is Write Only.
You should use e.g.
Dim rdr As New XmlTextReader("http://localhost/bookstore/book.xml")
Dim resolver as XmlUrlResolver = new XmlUrlResolver()
resolver.Credentials = CredentialCache.DefaultCredentials
rdr.XmlResolver = resolver

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/