Link to home
Start Free TrialLog in
Avatar of ZURINET
ZURINET

asked on

MemoryStream Convert.ToBase64String

Hallo
Need to convert a string to  base64 stream
any Idea..?
see code below

Thanks
StreamReader reader = new StreamReader(@"C:\Inetpub\ftproot\100.xml");
string parseInvResult = reader.ReadToEnd();
byte[] binaryData 
using (MemoryStream basePdfMemStream = new MemoryStream(Convert.ToBase64String(parseInvResult)))
				{
					binaryData = basePdfMemStream.ToArray();
				}

Open in new window

Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Base 64 is used to represent binary data as a string not the other way around.  Please clarify.
Avatar of ZURINET
ZURINET

ASKER

Hi wdosanjos

I have a need to provide base64 string for the datatype

byte[] Data;

in any XML file..

I have an xml document; I need to convert to base64 and insert it in into another xml document
i.e soap body  element.. defined as base64

what should be the best approach?

ASKER CERTIFIED SOLUTION
Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZURINET

ASKER

Answer not complete
Hi ZURINET,

What's missing?

Regards.