Hi,
Today when I was working on some images reading and updating to some other systems, I need to write a code for converting Byte Array to Base 64 and Vice Versa.
public static void ConvertByteArrayToBase64()
{
byte[] byteArray = File.ReadAllBytes(@"Image.png");
string strBase64 = Convert.ToBase64String(byteArray);
}
public static void ConvertBase64ToByteArray(string strBase64)
{
byte[] byteArray = Convert.FromBase64String(strBase64);
}
Hope this helps.
--
Happy CRM'img
Gopinath.
Today when I was working on some images reading and updating to some other systems, I need to write a code for converting Byte Array to Base 64 and Vice Versa.
public static void ConvertByteArrayToBase64()
{
byte[] byteArray = File.ReadAllBytes(@"Image.png");
string strBase64 = Convert.ToBase64String(byteArray);
}
public static void ConvertBase64ToByteArray(string strBase64)
{
byte[] byteArray = Convert.FromBase64String(strBase64);
}
Hope this helps.
--
Happy CRM'img
Gopinath.
No comments:
Post a Comment