[Help] HttpWebRequest Class : GetResponse Problem

Posts 1–3 of 3 · Page 1 of 1
[Help] HttpWebRequest Class : GetResponse Problem
Hey

I am working on my own msn program atm and I am sick and tired of this problem :S

Here is source :

Code:
Dim request As WebRequest = WebRequest.Create("http://h1.******.com/writetext/post.php?w=" & TextBox1.Text) ' Making a request to host server

        request.GetResponse() ' wait's for response
The code above "runs" a online php file...

Now the problem is that
Code:
request.GetResponse
have some kind of limit of requests that can be sendt :S

So after 3 create requests commands the app just freezes and can't connect to host server :S

Anyone know how to avoid this?
Is it any other way of doing it another way ?

Ok, let me explain a little more about what this does :
Code:
Dim request As WebRequest = WebRequest.Create("http://h1.******.com/writetext/post.php?w=" & TextBox1.Text)

        request.GetResponse()
This just runs a php file stores at host server and the php file writes a file with the information of value "w". and "w" = textbox1.text.

So it just writes an txt file to server... Any other way of having that done?

Highly appriciated !
getResponse doesn't actually wait for the response by the way. It returns (as would be expected from the method name 'get') a webresponse from your webrequest. It implements IDisposable so be sure to do something like

[highlight=vb.net]
Dim webReq As Net.HttpWebRequest = Ctype(Net.WebRequest.Create("ur"), Net.HttpWebRequest)
Using webResp As Net.HttpWebResponse = CType(webReq.getResponse, Net.HttpWebResponse)
End Using
[/highlight]

But, when you say 'writes a file', do you mean a local file, or a hosted file? Both are easily created and managed directly from VB.NET
Moved to VB section, probally get some more help here.
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Need help?