473,394 Members | 1,658 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,394 software developers and data experts.

ADODB.Stream is injecting line-breaks when read, why?

Although an ADODB question, I am using C#, so here I go.

I am trying to use the ADODB Stream object to extract content from a body
part of an MHTML formatted document. I can save the raw information and see
what it looks like. Now, when I go to do some extra processing, I need to
load the contents a body part using the code below. This is a general
method that should work for all body part. One of those body parts that I
need to process is HTML. The problem is that when I call ReadText, the
stream formats the text so that there is a CRLF after about 50 characters.
This is not good. How can I get back the exact HTML content using the ADODB
stream.

private ContentPartInfo PackageContent(IBodyPart bodyPart)

{

ContentPartInfo info = new ContentPartInfo();

info.MimeType =

(string)bodyPart.Fields[MhtmlDocument.ContentTypeFieldName].Value;

info.TransferEncoding =

(string)bodyPart.Fields[MhtmlDocument.ContentTransferEncodingFieldName].Valu
e;

info.Content =

bodyPart.GetEncodedContentStream().ReadText((int)S treamReadEnum.adReadAll);

return info;

}

Nov 15 '05 #1
0 1508

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

Similar topics

17
by: George Sakkis | last post by:
Is there a general way of injecting code into a function, typically before and/or after the existing code ? I know that for most purposes, an OO solution, such as the template pattern, is a cleaner...
3
by: Harry Hudini | last post by:
Hi, I have an asp page that needs to display the string that is returned from a cgi file. As an example, if you enter http://mydomain.com/mycgi.cgi?98127398 in to a browser, it will display...
2
by: Richard K Bethell | last post by:
Hi, We have an application, written in ASP, that uses the ADODB.Stream to be able to open files and write byte arrays to the Response object. If one of our administrators patches the web servers...
6
by: ASP.Confused | last post by:
I have an ASP.NET page writtein in VB that uses ADODB. I just had to force-install MDAC 2.8 after I tried to rollback to 2.6 (my web host uses this, and I wanted to be compatible with them.) I...
0
by: CountDraculla | last post by:
Fixing Multiple Database bug in adoDB popular data access layer for php, adoDB can support multiple databases from different provider at time, but not from same provider. what I mean is if you...
3
by: Hawksey | last post by:
Hello, I have an older CRM Web application, that we are not going to change to ..net that makes use of the ADODB object to load images into a SQL database (varbinary) field. I am rewriting an...
4
by: T | last post by:
-------------------------------------------------------------------------------- I tried this audit trail code, using 2003 and it works great, I try and use it at work w/97 and it blows up:...
14
by: ofiras | last post by:
Hii everyone, I'm a web programmer, but I never understood sql injecting. All I found was that you can write "a' or 'a'='a" in the password field to try to connect without knowing the password. I...
10
by: =?Utf-8?B?SnVhbg==?= | last post by:
Hi! I want to use ASP to download big files using ADODB.STREAM. It works very fine with files smaller than 80 MB. On the Webserver I can see that memory allocation and the process w3wp is...
3
gauravgmbhr
by: gauravgmbhr | last post by:
Hi All, I am trying to open a binary stream from a file and the creating a new stream from the opened stream and then trying to over wright the file and i am getting the following error ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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,...
0
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...
0
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...

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.