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).

適用於