By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,967 Members | 1,596 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,967 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.