View Single Post
  #17 (permalink)  
Old 02-05-2010, 02:50 PM
konisek's Avatar
konisek konisek is offline
Knows the basics
 
Join Date: Jan 2009
Posts: 55
Default

Yes, I have tried it. It gives me a NullReferenceException Error in match.Value = regex.Match(response.Headers)
But I suppose that my structure is not correct:
Code:
Sub Button1_Click
....
response.New1
request.New1 (URL)
request.Method = 
"POST"
request.TimeOut = 
60000
request.ContentType = 
"application/x-www-form-urlencoded"

stream.New1(Request.GetStream,
True)
stream.WriteBytes(stream.StringToBytes(name))
<font color=
"Red">request.GetAsyncResponse</font>

'reading cookie
regex.New1("PHPSESSID=.[a-zA-Z0-9]+")
match.New1
match.Value = 
regex.Match(response.Headers)
Session_ID = match.String

'operations with buffer() <font color="Blue">'Here I want to use the buffer from response_Stream</font>
....
TextBox4.Text = 
bit.BytesToString(buffer(), 4, count)
response.Close
End Sub

Sub request_Response
response.Value = <font color=
"Red">request.GetAsyncResponse</font>
<font color=
"Red">response.GetAsyncStream</font>
End Sub

Sub response_Stream  <font color="Blue">'Here I want to read the response and put it to array. And then I want to use it in  Sub Button1_click</font>
'
Get the response into array
bin.New1(response.GetStream, True)
bit.New1
Dim buffer(1024As byte
count = bin.ReadBytes(buffer(),
1024)
For i = 0 To ArrayLen(buffer())-1
retezec = retezec & 
" " & buffer(i)
Next 
Msgbox(retezec)
End Sub

Last edited by konisek : 02-05-2010 at 02:54 PM.
Reply With Quote