English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Ok, what I want to do is create a program that will acess a currency exchange rate website every time it starts up and get the exchange rates. I was thinking of putting the text of the website into a string variable, then finding the actual rates with keywords, but I don't know how to actually acess the internet. Any help?

2006-11-06 04:48:44 · 2 answers · asked by Anonymous in Computers & Internet Programming & Design

2 answers

I don't know if this was available in VB 6.0, but in VB.Net you do this:

Dim Url As String = "[URL here]"
Dim PageRequest As HttpWebRequest = _
CType(WebRequest.Create(Url), HttpWebRequest)
Dim PageResponse As WebResponse = _
PageRequest.GetResponse()
Console.WriteLine("Response received.")
Dim r As New StreamReader(PageResponse.GetResponseStream())
Dim Page As String = r.ReadToEnd()
r.Close()

Convoluted, I know, but that's the Microsoft way...

2006-11-06 05:00:06 · answer #1 · answered by NC 7 · 0 0

make a reference to the microsoft xml 4.0


Dim web As New XMLHTTP40
Dim theXML As DOMDocument40
Dim str as string

web.Open "GET", ""
web.send


Set theXML = web.responseXML

str = theXML.documentElement.getElementByTagName("")


this is a general concept if you can get a RSS feed from the site then this will work perfectly good luck

2006-11-06 13:48:23 · answer #2 · answered by Anonymous · 0 0

fedest.com, questions and answers