Parsing an xml document at a remote URL using VB 6

2019-07-18 14:27发布

问题:

I am trying to parse through the contents of an xml file resident on a remote server in visual basic 6.0 using the MSXML2.DOMDocument class.

I am using the Load method of the MSXML2.DOMDocument class to pass in the url. The url is of the form http://<server>/ABC.xml, however, the server requires user credentials for accessing the file.

How do I pass in user credentials using this class or another supporting class?

回答1:

You can use http://<username>:<password>@<server>/ABC.xml in many cases, or you can use the XMLHTTPRequest helper object to make the actual requests.

Note that when you use an MSXML DOMDocument object you aren't parsing anything, the object does the heavy lifting. All you're doing is navigating the DOM tree, a trivial task by comparison.



标签: vb6 msxml