Private Void Page_load ( Object Sender, system. eventargs E)
{
String URL = Request. querystring [ " Photo " ];
Byte [] BYT = Convert. frombase64string (URL );
Response. Clear ();
Response. contenttype = " Image/JPEG " ;
Response. binarywrite (BYT );
Response. End ();
}
You can obtain a base64 encoded string from the request, and then convert the image using the convert. frombase64string method.
It is a binary array and then displayed on the page through response
But how can we convert an image into a livestream?
Base64-encoded
Byte[] BYT=Convert. frombase64string (URL );
Stream stream = new memorystream (html2bytes );
If base64 encoding is not performed, assume that it is a piece of plain text.
Stream stream = NULL;
String html = "dsf3d43dsds4158dfdsfdsfsadfdsfjhgkhgkj678gdrkl65kjf94jdf8f8 this is not base64 encoded ";
Byte [] html2bytes = system. Text. encoding. ASCII. getbytes (HTML );
Stream = new memorystream (html2bytes );