473,786 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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)bodyPar t.Fields[MhtmlDocument.C ontentTypeField Name].Value;

info.TransferEn coding =

(string)bodyPar t.Fields[MhtmlDocument.C ontentTransferE ncodingFieldNam e].Valu
e;

info.Content =

bodyPart.GetEnc odedContentStre am().ReadText(( int)StreamReadE num.adReadAll);

return info;

}

Nov 15 '05 #1
0 1535

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

Similar topics

17
6526
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 way to get the same effect, but it's not always applicable (e.g. if you have no control over the design and you are given a function to start with). In particular, I want to get access to the function's locals() just before it exits, i.e....
3
7859
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 YES or NO I need to have my asp code query this url, get the resulting string, then act upon it (basically use the answer to display a nice big tick or a big
2
690
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 this application runs on in Windows Update, I'm screwed, right? You've essentially just disabled this COM object, for not only its evil purposes, but its useful ones? Richard
6
4141
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 had to manually install all of the ODBC drivers and the rest of the DLL's, and now I am getting "Access is Denied" errors on any page that uses ADODB. How do I fix it? I already gave the ODBC drivers in the folders in "c:\program files\common...
0
3248
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 instantiate two adoDB connection like this $db1 = &NewAdoConnection ("mysql"); $db1 = &NewAdoConnection ("oracle"); then you can run queries simultaneously from these connections. but if
3
2071
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 application in .NET that retrieves these images. I have used the following article to retrieve the image from the Database http://support.microsoft.com/default.aspx?scid=kb;en-us;316887. The image is written to the filesystem, but does not...
4
4286
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: Compile error, user defined type not defined I assume the ADODB is the problem? How would I change / fix this to work w/97 Table called UserLog w/field UserName txt
14
1786
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 heard that there are many other ways to do sql injecting, and I never found how. I know that you can even manage to get data from sql tables using sql injecting. How can it be? How can someone do it? Please help,
10
19370
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 running. After some time (more or less 2 minutes) I get a response timeout. Here is the code:
3
9246
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 ADODB.Stream error '800a0bbc' Write to file failed. /cops/RestartV1.asp, line 80
0
10169
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
10110
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
9964
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
7517
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
6749
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();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
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
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.