The following editor will bring you an article on the conversion method of picture .BYTE[] and base64string in C#. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.
In C
#Conversion of image to byte[] and then to base64string:
1 2 3 4 5 6 7 8 |
|
Conversion from base64string to byte[] and then to image:
1 2 3 4 5 6 |
|
In current database development: images are generally stored in CLOB: storing base64string
BLOB: store byte[]
It is generally recommended to use byte[]. Because pictures can be directly converted to byte[] and stored in the database
If you use base64string, you need to convert from byte[] to base64string. More waste of performance.
The above is the detailed content of Detailed explanation of the conversion method of image .BYTE[] and base64string in C#. For more information, please follow other related articles on the PHP Chinese website!