Insert image into xml file using c#
- Read all the bytes into memory usingFile.ReadAllBytes().
- Convert the bytes to a Base64 stringusing Convert.ToBase64String().
- Write the Base64 Encoded string toyour element content.
Doneski!
You can use a CDATA part or simply put all the bytes in their hexadecimal form as a string.Another option is to use a base64 encoding
The element you use is up to you.