vb.net send multiple connections at the same time
Code:
Public Class Form1
Dim thread1 As System.Threading.Thread
Private sub sendReq()
'Header Options
Request.Method = "GET"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0"
Request.AllowAutoRedirect = True
Request.MaximumAutomaticRedirections = 9
Request.Headers.Add("pragma", "no-cache")
Request.Headers.Add("Accept-Encoding", "gzip,deflate,sdch")
Request.Headers.Add("cache-control", "no-cache")
Request.AllowWriteStreamBuffering = True
'Creating the responsder and Stream Reader
Dim Response As HttpWebResponse = Request.GetResponse
Dim ResponseStream As System.IO.Stream = Response.GetResponseStream
'Creating Another Stream Reader
Dim StreamReader As New System.IO.StreamReader(ResponseStream)
Dim Data As String = StreamReader.ReadToEnd
StreamReader.Close()
Response.Close()
...etc
End Sub
thread1 = New Thread(AddressOf Me.sendReq)
thread1.Start()
Please tell me that changes should i do, to send multiple connections
Re: vb.net send multiple connections at the same time
You can use that code and some simple multi-threading to achieve this.
Re: vb.net send multiple connections at the same time
Quote:
Originally Posted by
Niya
You can use that code and some simple multi-threading to achieve this.
Hi Niya,
Thank you for your replay, could you please give me some hints, maybe some codes , how to achieve that
Re: vb.net send multiple connections at the same time
You mean you don't know how to use threads and you have a Thread object created in your code ?