System.IO.InTheHandRuntimeStorageExtensions.OpenStreamForReadAsync C# (CSharp) Méthode

OpenStreamForReadAsync() public static méthode

Retrieves a stream for reading from a specified file.
public static OpenStreamForReadAsync ( this windowsRuntimeFile ) : Task
windowsRuntimeFile this
Résultat Task
        public static Task<Stream> OpenStreamForReadAsync(this IStorageFile windowsRuntimeFile)
        {
#if WINDOWS_UWP || WINDOWS_APP || WINDOWS_PHONE_APP || WINDOWS_PHONE
            return WindowsRuntimeStorageExtensions.OpenStreamForReadAsync((global::Windows.Storage.StorageFile)((StorageFile)windowsRuntimeFile));
#elif __ANDROID__ || __UNIFIED__ || WIN32
            if (windowsRuntimeFile == null)
            {
                throw new ArgumentNullException("windowsRuntimeFile");
            }
            
            return Task.FromResult<Stream>(global::System.IO.File.OpenRead(windowsRuntimeFile.Path));
#else
            throw new PlatformNotSupportedException();
#endif
        }

Same methods

InTheHandRuntimeStorageExtensions::OpenStreamForReadAsync ( this rootDirectory, string relativePath ) : Task
InTheHandRuntimeStorageExtensions