Re: NNTP Image reader
- From: "nondos" <nondos@xxxxxxxxxx>
- Date: Mon, 11 Jun 2007 12:57:22 +0300
I've found the problem for anyone who have the same problem:
I did not realize that the NNTP-protocol requires to double a dot in the first colum when a line is sent - and to detect a double dot (and remove one of them) when receiving a line.
"nondos" <nondos@xxxxxxxxxx> wrote in message news:JcGdnV9Pf8APiPDbRVnyvQA@xxxxxxxxxxxxxxx
Hello
I coded vb.net 2005 application to d.l binary pictures file from news network server and then decode the file with yEnc and show the pictures.
the code work fine, but the files i d.l from the newsgroups are corrupt most of the time, it's possible to decode the files with yenc and most of the picture is fine but there's some bugs on the picture.
I tested the files with commerical NNTP program and the files are fine.
First I tought maybe i lost data in the tcp ip transfer between me and the newsgroups but then i noticed that the picture have the same bug everytime i d.l it
That's mean i think i have problem with the encoding of the data i get from the server and one char or maybe more ain't encoding well and it's courrpt the file i'm using the "windows-1252"
any idea what can i do?
thanks
-----code-------
Private Sub ReadToFile(ByVal file As String)
Dim sw As New System.IO.StreamWriter(file, False, System.Text.Encoding.GetEncoding("Windows-1255"))
Dim yEnc As New TextCodec.Yenc
Dim output As String = ""
streamReader = New System.IO.StreamReader(networkStream, System.Text.Encoding.GetEncoding("Windows-1255"))
streamReader.ReadLine()
Do While streamReader.Peek > 0
System.Threading.Thread.Sleep(1)
If output <> "" Then output = output & vbCrLf
output = output & streamReader.ReadLine
Loop
yEnc.Decode(output, "c:\test\", 0)
sw.Write(output)
sw.Flush()
sw.Close()
End Sub
.
- References:
- NNTP Image reader
- From: nondos
- NNTP Image reader
- Prev by Date: Re: Reset desktop
- Next by Date: Re: need some help
- Previous by thread: NNTP Image reader
- Next by thread: Reset desktop
- Index(es):
Relevant Pages
|