Image image = Image.FromFile(@"C:UsersswkjDocumentsVisual Studio 2012ProjectsWebApplication9WindowsFormsApplication1ali.jpg");//这是你图片文件的
MemoryStream stream = new MemoryStream();
image.Save(stream, ImageFormat.Bmp); //把图片保存到流中。
byte[] b = stream.ToArray();
string i = string.Empty;
//foreach (var a in b)
//{
// i += a;
//}
string a = Convert.ToBase64String(b); //base64加密