hi
we are trying to use google to get exchange rate prices.
they use a csv file which we get the code to go out and get.
what im trying to do is pick the first line of the file and just use that. i have the following code but its not just picking the one line.
anyone any ideas
we are trying to use google to get exchange rate prices.
they use a csv file which we get the code to go out and get.
what im trying to do is pick the first line of the file and just use that. i have the following code but its not just picking the one line.
anyone any ideas
VB.NET:
Dim strURL As String
'Creates the request URL for Yahoo
strURL = "http://www.google.com/finance/historical?q="
strURL &= Me._symbol
strURL &= "&output=csv"
Dim req As System.Net.WebRequest
Dim resp As System.Net.WebResponse
req = System.Net.HttpWebRequest.Create(strURL)
Try
resp = req.GetResponse()
'Read the answer from the Web site and store it into a stream
Me._reader = New IO.StreamReader(resp.GetResponseStream)
Me._reader.ReadLine()
' reads the second line and splits it into a string array.
Dim firstLineOfData As String() = Me._reader.ReadLine().Split(New Char() {","c})
MsgBox(firstLineOfData)
' first field in array
Dim theDate As Date = Date.Parse(firstLineOfData(0))
'Parse the header to create columns
Me._history = New DataTable("YahooLastPrice")
'Parse the body of the downloaded data
Me.header(Me._history)
Me.body(Me._history)
resp.Close()