Wednesday, 11 September 2013

FileIO.ReadAllBytes in Windows 8 app

FileIO.ReadAllBytes in Windows 8 app

I'm trying to use FileIO.ReadAllBytes and File.ReadAllBytes in my Win 8
app but there is an error:
'Windows.Storage.FileIO' does not contain a definition for 'ReadAllBytes'
My code:
byte[] bytes = FileIO.ReadAllBytes(@"image.png");
string encoded = Convert.ToBase64String(bytes);
string content = "file1=" + encoded + "";

No comments:

Post a Comment