简体   繁体   中英

How to send image through XML using C#

I have a image that I need to embed in XML and then retrieve the image using C#. How can I do this?

Convert it to a byte[] and convert this to a Base64 datablock (using Convert.ToBase64String() ), which you put into the xml. On the other side, you simply have to decode it with Convert.FromBase64String() and deal with the resulting byte[] the way you like.

Either you have to include binary data in XML tags; or you need to put the image somewhere else and send the link with your XML

you can convert your image into base64 data and write in xml !

help:

code snippet

stackoverflow discussion

embed image in xml? You mean putting image in a xml document?

See the link http://www.codeproject.com/KB/cs/lookchanger.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM