public static string GetBase64Data()
{ string path = @"C: \txt.jpg"; FileStream filestream = new FileStream(path, FileMode.Open); byte[] bt = new byte[filestream.Length]; //调用read读取方法 filestream.Read(bt, 0, bt.Length); string base64Str = Convert.ToBase64String(bt); filestream.Close(); return base64Str; }