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

OpenStreamForReadAsync() public static méthode

Retrieves a stream for reading from a file in the specified parent folder.
public static OpenStreamForReadAsync ( this rootDirectory, string relativePath ) : Task
rootDirectory this The Windows Runtime IStorageFolder object that contains the file to read from.
relativePath string The path, relative to the root folder, to the file to read from.
Résultat Task
        public static Task<Stream> OpenStreamForReadAsync(this IStorageFolder rootDirectory, string relativePath)
        {
#if WINDOWS_UWP || WINDOWS_APP || WINDOWS_PHONE_APP || WINDOWS_PHONE
            return WindowsRuntimeStorageExtensions.OpenStreamForReadAsync((global::Windows.Storage.StorageFolder)((StorageFolder)rootDirectory), relativePath);
#elif __ANDROID__ || __UNIFIED__ || WIN32
            string newPath = Path.Combine(rootDirectory.Path, relativePath);
            return Task.FromResult<Stream>(global::System.IO.File.OpenRead(newPath));
#else
            throw new PlatformNotSupportedException();
#endif
        }

Same methods

InTheHandRuntimeStorageExtensions::OpenStreamForReadAsync ( this windowsRuntimeFile ) : Task
InTheHandRuntimeStorageExtensions