473,657 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByVa l file As String)

Dim sw As New System.IO.Strea mWriter(file, False,
System.Text.Enc oding.GetEncodi ng("Windows-1255"))

Dim yEnc As New TextCodec.Yenc

Dim output As String = ""

streamReader = New System.IO.Strea mReader(network Stream,
System.Text.Enc oding.GetEncodi ng("Windows-1255"))

streamReader.Re adLine()

Do While streamReader.Pe ek 0

System.Threadin g.Thread.Sleep( 1)

If output <"" Then output = output & vbCrLf

output = output & streamReader.Re adLine

Loop

yEnc.Decode(out put, "c:\test\", 0)

sw.Write(output )

sw.Flush()

sw.Close()

End Sub

Jun 11 '07 #1
1 1957
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******** *************@g iganews.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(ByVa l file As String)

Dim sw As New System.IO.Strea mWriter(file, False,
System.Text.Enc oding.GetEncodi ng("Windows-1255"))

Dim yEnc As New TextCodec.Yenc

Dim output As String = ""

streamReader = New System.IO.Strea mReader(network Stream,
System.Text.Enc oding.GetEncodi ng("Windows-1255"))

streamReader.Re adLine()

Do While streamReader.Pe ek 0

System.Threadin g.Thread.Sleep( 1)

If output <"" Then output = output & vbCrLf

output = output & streamReader.Re adLine

Loop

yEnc.Decode(out put, "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
3631
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 application, while I am doing for web. I can only find Image from web forms control and HTML control. This may be the root cause of my problem. For read button, I converted his VB to the C#. But the compiler complains:
5
2185
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 details of a random image from an access database. I know this works because when I run the query in access, it picks a different image each time (or close enough). However, when I view the .aspx page that this code-behind is for, it always picks...
2
3745
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. At least when I execute the following code, I get some significant network traffic. When I check the database with query analyzer, I see 4 Hex Chars in the image colum. Like 0xe0 etc.
7
11613
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 is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
9
8771
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 OleDbCommand("ImageBlobUpdate", dataConnection) Command.CommandType = CommandType.StoredProcedure)
9
1844
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 suggetion that would help would be highly appreciated. -- Iyke
9
2681
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 from my web site to be readable via a NNTP interface. So, when the client connects to my server, a hierarchy might look like this: sandman.forum.gaming sandman.forum.media sandman.articles.weblogs
1
2689
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 which everyone on many sites said to do. The problem is its not working. My exact situation is that I am creating News Articles based on news entries which are either text or pictures. I want to display a picture in the datagrid if there is one....
3
2737
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 PASS password <where password=my groups.google password Any suggestions, what am i doing wrong. I keep getting 502 permission denied.
0
8325
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6177
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1734
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.