Hey guys, new to the forums. I usually spend a few hours messing around trying to figure out my problem before I ask on a forum, and well here I am. I know VB6 like the back of my hand but have decided to move up to VB.NET. All I'm trying to do is return all the data from a Netstream. I know how to get the data, but it's not returning all the HTML data that I need. Here's an example:
As you can see at the bottom, it cuts off the other half of the data return. Here's my code:
Now it's returning exactly what I want, but it's not returning the second half of the HTML data return that I need to continue on my project (assuming because it's too long). The dat length is 8,193 and I'm assuming the actual html file is around 16,000-20,000 characters. Is there some kind of loop that I need to run to make sure it reads everything or is it not even possible? I'm open to all ideas or new methods of returning data. This is a piece of cake in VB6 with winsock, but with sockets.tcpclient it's a little more technical. Any help would be greatly appreciated.

As you can see at the bottom, it cuts off the other half of the data return. Here's my code:
VB.NET:
Dim Ws As New System.Net.Sockets.TcpClient
Dim Packet As String = ""
Dim X As Integer = 0
Ws.Connect("games.yahoo.com", "80")
Dim Networks As NetworkStream = Ws.GetStream()
If Networks.CanWrite And Networks.CanRead Then
Packet$ = "GET /games/ante?room=towers_beg&prof_id=chat_pf_1 HTTP/1.1" & vbNewLine & _
"Host: games.yahoo.com" & vbNewLine & _
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" & vbCrLf & _
"Connection: Close" & vbNewLine & _
"Cookie: " & YCookie & vbNewLine & vbNewLine
Dim SendBytes As Byte() = Encoding.ASCII.GetBytes(Packet$)
Networks.Write(SendBytes, 0, SendBytes.Length)
Dim bufferSize As Integer = Ws.ReceiveBufferSize
Dim myBufferBytes(bufferSize) As Byte
Networks.Read(myBufferBytes, 0, bufferSize)
Dim Dat As String = Encoding.ASCII.GetString(myBufferBytes)
frmYTLogin.TextBox2.Text = frmYTLogin.TextBox2.Text & Dat
Now it's returning exactly what I want, but it's not returning the second half of the HTML data return that I need to continue on my project (assuming because it's too long). The dat length is 8,193 and I'm assuming the actual html file is around 16,000-20,000 characters. Is there some kind of loop that I need to run to make sure it reads everything or is it not even possible? I'm open to all ideas or new methods of returning data. This is a piece of cake in VB6 with winsock, but with sockets.tcpclient it's a little more technical. Any help would be greatly appreciated.
Last edited: