-
April 24th, 2015, 08:59 PM
#1
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
-
April 28th, 2015, 02:39 AM
#2
Re: vb.net send multiple connections at the same time
You can use that code and some simple multi-threading to achieve this.
-
April 28th, 2015, 03:57 AM
#3
Re: vb.net send multiple connections at the same time
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
-
April 28th, 2015, 03:51 PM
#4
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 ?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|