图片与流互转
FileStream stream = new FileStream(Server.MapPath("aa/Logo.jpg"), FileMode.Open, FileAccess.Read);
byte[] blob = new byte[stream.Length];
stream.Read(blob, 0, (int)stream.Length);
stream.Close();
string a = "";
for (int i = 0; i < blob.Length; i++)
{
a = a + blob[i].ToString();
Response.Write(a);
}
FileStream fs = new FileStream("c:\\b.jpeg", FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fs);
bw.Write((byte[])blob);
bw.Close();
hahaimage.ImageUrl = "c:\\b.jpeg";