Hi guys, i want to take exchange rate data from website to vb.net (txtbox) but idk i have tried many codes many times and still it does not work.
When i try only that command, i see all things about this address, but i want to see only exp EUR-USD.
Dim request As WebRequest = WebRequest.Create("https://www.iban.com/currency-converter")
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim datastream As Stream = response.GetResponseStream
Dim reader As New StreamReader(datastream)
Dim strdata As String = reader.ReadToEnd
TextBox1.Text = strdata
Please help me.
Thank you!
What I have tried:
Dim pos1 As Long, pos2 As Long, USD As String
Dim request As WebRequest = WebRequest.Create("https://www.iban.com/currency-converter")
Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim datastream As Stream = response.GetResponseStream
Dim reader As New StreamReader(datastream)
Dim strdata As String = reader.ReadToEnd
'TextBox1.Text = strdata
pos1 = InStr(strdata, "EUR")
pos1 = InStr(pos1 + 1, strdata, "", vbTextCompare)
pos2 = InStr(pos2 + 9999, strdata, "", vbTextCompare)
USD = strdata.Substring(pos1, pos2)
TextBox1.Text = USD