MemoryStream stream = new MemoryStream(b, true);
string strCmd = String.Format("SELECT photo FROM Photos WHERE id = {0}", index);
SqlCommand cmd = new SqlCommand(strCmd, sqlConn);
byte[] b = (byte[])cmd.ExecuteScalar();
if(b.Length > 0)
{
System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true);
stream.Write(b, 0, b.Length);
image=new Bitmap(stream);
stream.Close();
}
其中下面代码中参数(b, true)是什么意思呢?
System.IO.MemoryStream stream = new System.IO.MemoryStream(b, true);