473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

NNTP Image reader

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

Jun 11 '07 #1
1 1946
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" <no****@nondos.orgwrote in message
news:Jc*********************@giganews.com...
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
Jun 11 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dale zhang | last post by:
Hi, I am trying to read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp The article author is using PictureBox for windows...
5
by: Haydnw | last post by:
Hi, I have the code below as code-behind for a page which displays two images. My problem is with the second bit of code, commented as " 'Portfolio image section". Basically, the SQL query gets...
2
by: Chucker | last post by:
Hi Community, I think I can store Binary Data in SQL Server but when I try to retrieve it, I always only get one byte. I think I stored my Binary Data in SQL Server in a Colum of Type Image....
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
9
by: Tom John | last post by:
Hi I am storing images in an access database, based on an MSDN article. The code i use to store is as follows: <code> 'Create the command object Dim command As New...
9
by: JuniorProgrammer | last post by:
Please This is queit a task av been trying to solve. Could anyone please tell me how to read a blob from an SQL using a dataset and stuffing this image into the Image control of a webform. Any...
9
by: Sandman | last post by:
Ok, I do NOT want to *connect* to a NNTP server from PHP, I want to - from a NNTP client - connect to a NNTP server that is powered by PHP. Specifically, I want articles, forum posts and such...
1
by: rascalking | last post by:
Hello, So I've read many forums that explained how to get an image out of SQL Server database and display it. I used an alternate .aspx page to retrieve the image and write it back as binary...
3
by: Alexander Higgins | last post by:
Hi, I am working on an NNTP Client via windows forms and am actually try to login into this group to no avail. I am sending AUTHINFO USER username <where username=myemail address AUTHINFO...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.