Hi
I am using the following code to obtain a response from a web page:
I am using a StreamReader to convert the return into a string:
I want to take the result returned from the web request and put it into an array, preferabily a 2d array.
Here is a sample of the web request:
Here are the results that I get back:
I know that I can do it by doing a loops to determine how many "," are in the string, followed by a loop that gets each value and inserts it into the array.
Is there instead a more effective approach, I know that when you want to convert an array to a comma-seperated string you can use the command:
Is there any method that does the reverse? Alternatively, can I use datatables?
Mike55.
I am using the following code to obtain a response from a web page:
Code:
objRequest = System.Net.HttpWebRequest.Create(HttpPaymentRequestUrl(receiptCode))
objResponse = objRequest.GetResponse()
I am using a StreamReader to convert the return into a string:
Code:
Dim sr As New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd
I want to take the result returned from the web request and put it into an array, preferabily a 2d array.
Here is a sample of the web request:
https://www.gatewayURL/EPG/QUERY?Receipts=21051541119&Login_Name=XXX&Logi
n_Password=XXXX&Version=2.0
Here are the results that I get back:
Receipt,Identifier,Amount,Auth,ReasonCode,Status,Batch
21051541119,test,0.2,REFERRAL A,02,F,
I know that I can do it by doing a loops to determine how many "," are in the string, followed by a loop that gets each value and inserts it into the array.
Is there instead a more effective approach, I know that when you want to convert an array to a comma-seperated string you can use the command:
Code:
String.Join(",", arrayName)
Is there any method that does the reverse? Alternatively, can I use datatables?
Mike55.
Last edited by a moderator: