ExternalStorageFile.OpenForReadAsync Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Opens a stream over the current file for reading file contents. (This method cannot be used in Silverlight 8.1 apps. See remarks.)
Namespace: Microsoft.Phone.Storage
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
Syntax
Public Function OpenForReadAsync As Task(Of Stream)
public Task<Stream> OpenForReadAsync()
Return Value
Type: System.Threading.Tasks..::.Task<(Of <(Stream>)>)
Returns a stream to the current file.
Remarks
Your app must register for a file association in the app manifest file to declare what file types (extensions) can be read from the SD card. For more info, see Auto-launching apps using file and URI associations for Windows Phone 8.
Important Note: |
---|
You can’t use the OpenForReadAsync()()() method in Silverlight 8.1 apps. Instead, access the SD card by using the RemovableDevices property of the KnownFolders class to get a reference to the SD card as a StorageFolder. Then get a reference to the file by calling the GetFileAsync method of the StorageFolder. Finally open the file for reading by calling the OpenReadAsync method or another method of the StorageFile class. |
Version Information
Windows Phone OS
Supported in: 8.1, 8.0