public static string Serialize(string fileName) { using (FileStream reader =new FileStream(fileName, FileMode.Open)) { byte[] buffer =new byte[reader.Length]; reader.Read(buffer, 0, (int)reader.Length); string ret=Convert.ToBase64String(buffer); reader.Close(); return ret; } }