By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 1,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

Can someone take a look at this and see if they can find the problem?

P: n/a
i'm working on a program that downloads from news groups.

it works fine on (UUE and MIME" encoded files but when you get to a
yenc encoded file it messes up. the lines are all diffrent lengths and
they can not be decoded.

it must be in the way i'm getting the info back from the server.

could someone take a look at the code or maybe tell me a better way to
get the info back from the server?

i have can not think of anything else to try..


Public Sub Connect(ByVal hostNameOrAddress As String, ByVal port As

Dim serverAddress As IPAddress
serverAddress =
Catch ex As Exception
Throw New Exception("Could not resolve Host name or
Address.", ex)
Exit Sub
End Try

_MySocket = New TcpClient(hostNameOrAddress, port)
Catch ex As Exception
_Connected = False

End Try

_MySocket.GetStream.BeginRead(_Mydata, 0, 1024, AddressOf
ReceiveCallback, Nothing)

End Sub

Private Sub ReceiveCallback(ByVal ar As IAsyncResult)
Dim intCount As Integer

intCount = _MySocket.GetStream.EndRead(ar)
If intCount < 1 Then
'Me.IsConnected = False
Exit Sub
End If

BuildString(_Mydata, 0, intCount)

_MySocket.GetStream.BeginRead(_Mydata, 0, 1024, _
AddressOf ReceiveCallback, Nothing)
Catch e As Exception
End Try
End Sub

Private Sub BuildString(ByVal Bytes() As Byte, _
ByVal offset As Integer, ByVal count As Integer)
Dim intIndex As Integer

For intIndex = offset To offset + count - 1
If Bytes(intIndex) = 10 Then

Dim params() As Object = {mobjText.ToString}
Dim s As String =

For i As Integer = 0 To params.Length - 1
_TextB = s

mobjText = New StringBuilder
End If
End Sub

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.