通过文件流把图片变成留转成字符,或者把字符通过留生成图片
FileStream photo = new FileStream("test.jpg", FileMode.Open);
byte[] buffer = new byte[65000];
photo.Read(buffer, 0, buffer.Length);
Console.WriteLine("这里将图片转成String:");
string photoStr = Encoding.ASCII.GetString(buffer);
Console.Write("转换成功!");
photo.Close();
Console.WriteLine("以下是讲String转换成图片:");
FileStream newPhoto = new FileStream("newPhoto.jpg", FileMode.Create);
newPhoto.Write(buffer, 0, buffer.Length);
//Image ima = Image.FromStream(newPhoto);
newPhoto.Close();
Console.WriteLine("转换成功!");
Console.ReadKey();