|
Here is the code that displays the picture:
1 object result = cmd.ExecuteScalar ();
2 Stream stream = new MemoryStream ((byte []) result);
3 const int buffersize = 1024 * 16;
4 byte [] buffer = new byte [buffersize];
5 int count = stream.Read (buffer, 0, buffersize);
6 while (count> 0)
7 {
8 Response.OutputStream.Write (buffer, 0, count);
9 count = stream.Read (buffer, 0, buffersize);
10}
Why does line 3 use the constant buffersize = 1024 * 16?
If any big brother has time, can you tell me more about the meaning of this code? For example, I don't understand the second line.
Or is there any other way to display the picture (image type) in the database?
Thank you, thank you very much! ~ |
|