Partager via


ResourceManager.GetStream Method (String, CultureInfo)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns an UnmanagedMemoryStream object from the specified resource, using the specified culture.

Namespace:  System.Resources
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
<ComVisibleAttribute(False)> _
Public Function GetStream ( _
    name As String, _
    culture As CultureInfo _
) As UnmanagedMemoryStream
[ComVisibleAttribute(false)]
public UnmanagedMemoryStream GetStream(
    string name,
    CultureInfo culture
)

Parameters

  • culture
    Type: System.Globalization.CultureInfo
    The culture to use for the resource lookup. If culture is nulla null reference (Nothing in Visual Basic), the culture for the current thread is used.

Return Value

Type: System.IO.UnmanagedMemoryStream
An unmanaged memory stream.

Exceptions

Exception Condition
InvalidOperationException

The value of the specified resource is not a MemoryStream object.

ArgumentNullException

name is nulla null reference (Nothing in Visual Basic).

MissingManifestResourceException

No usable set of resources is found, and there are no neutral resources.

Remarks

The GetStream method takes the name of a resource that is stored as a MemoryStream object, gets the value of the Object resource, and returns an UnmanagedMemoryStream object. The resource lookup is based on the culture specified by the culture parameter. If culture is nulla null reference (Nothing in Visual Basic), the culture for the current thread is used.

This method is useful primarily for performance reasons: retrieving a resource as a UnmanagedMemoryStream object instead of an explicit object can improve performance.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.