how to save HTML in byte[] as Image??? c#
i have HTML page source of website saved as String in string PageSource;
i need to save it in SQL Database as Image开发者_JAVA百科 of type image.
How to convert PageSource
in byte[] and save it as Image in database.
You can use the following code to convert a string to a byte array, which can then be saved in a database image field.
var bytes = Encoding.Default.GetBytes(htmlString);
Use of image will be deprecated, consider using varbinary(max).
精彩评论