Ejemplo n.º 1
0
 public static async Task<Stream> GetFileStream(Windows.Storage.StorageFile file)
 {
    return await file.OpenStreamForReadAsync();
 }
Ejemplo n.º 2
0
        async Task<string> ReadFile(Windows.Storage.StorageFile file)
        {
            if (file != null)
            {
                // Read the data.
                using (StreamReader streamReader = new StreamReader(await file.OpenStreamForReadAsync()))
                {
                    var rtn = streamReader.ReadToEnd();
                    if (!string.IsNullOrWhiteSpace(rtn))
                    {
                        return rtn;
                    }
                    else
                    {
                        return "unable to read file";
                    }
                }
            }

            return "unable to find file";

        }