使用 VB 6.0 解析远程 URL 处的 xml 文档 [英] Parsing an xml document at a remote URL using VB 6.0

查看:23
本文介绍了使用 VB 6.0 解析远程 URL 处的 xml 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 MSXML2.DOMDocument 类解析驻留在 Visual Basic 6.0 中远程服务器上的 xml 文件的内容.

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.

我正在使用 MSXML2.DOMDocument 类的 Load 方法来传递 url.url 的格式为 http:///ABC.xml,但是,服务器需要用户凭据才能访问该文件.

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?

推荐答案

你可以在http://:@/ABC.xml中使用许多情况下,或者您可以使用 XMLHTTPRequest 帮助器对象来发出实际请求.

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.

请注意,当您使用 MSXML DOMDocument 对象时,您并未解析任何内容,该对象会执行繁重的工作.您所做的只是浏览 DOM 树,相比之下,这是一项微不足道的任务.

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.

这篇关于使用 VB 6.0 解析远程 URL 处的 xml 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆