WindowsRuntimeStreamExtensions.AsRandomAccessStream(Stream) WindowsRuntimeStreamExtensions.AsRandomAccessStream(Stream) WindowsRuntimeStreamExtensions.AsRandomAccessStream(Stream) Method

定义

重要

此 API 不符合 CLS。

将指定的流转换为随机访问流。Converts the specified stream to a random access stream.

public:
[System::Runtime::CompilerServices::Extension]
 static Windows::Storage::Streams::IRandomAccessStream ^ AsRandomAccessStream(System::IO::Stream ^ stream);
[System.CLSCompliant(false)]
public static Windows.Storage.Streams.IRandomAccessStream AsRandomAccessStream (this System.IO.Stream stream);
static member AsRandomAccessStream : System.IO.Stream -> Windows.Storage.Streams.IRandomAccessStream

参数

stream
Stream Stream Stream

要转换的流。The stream to convert.

返回

表示转换流的 Windows 运行时 IRandomAccessStreamA Windows Runtime IRandomAccessStream, which represents the converted stream.

注解

备注

在 Visual Basic 中和C#,可以为任何类型的对象上的实例方法调用此方法StreamIn Visual Basic and C#, you can call this method as an instance method on any object of type Stream. 当使用实例方法语法调用此方法时,请省略第一个参数。When you use instance method syntax to call this method, omit the first parameter. 有关详细信息,请参阅扩展方法 (Visual Basic)扩展方法 (C#编程指南)For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

适用于