Re: NNTP Image reader

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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


.



Relevant Pages

  • Re: Print Preview !!!
    ... Visio Development Blog ... Public Sub New ... Dim temporaryShape As Microsoft.Office.Interop.Visio.Shape ... ' picture is the size of the page. ...
    (microsoft.public.visio.developer)
  • RE: Programatically insert pictures into a table field
    ... achieve was a high level of evidence integrity, ... If you have a picture control on a form or report, ... The class object is defined with Get & Let properties as well as ... Dim rstCheques As DAO.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • Re: Need Help With Hyperlink Macro
    ... Dim PicDlg As Dialog ... Dim FName As String ... ' now move insertion point to end of picture just inserted ... the picture itself a hyperlink but rather creates a separate hyperlink line ...
    (microsoft.public.word.vba.general)
  • Re: Need Help With Hyperlink Macro
    ... Dim PicDlg As Dialog ... Dim FName As String ... ' now move insertion point to end of picture just inserted ... the picture itself a hyperlink but rather creates a separate hyperlink line ...
    (microsoft.public.word.vba.general)
  • Re: Need help w using custom image for custom toolbar in Excel 200
    ... I don't quite understand what you're accomplishing by inserting the picture by ... Sub Auto_Open ... Dim MacNames As Variant ... CenterH As Boolean, CenterV As Boolean) ...
    (microsoft.public.excel.programming)