Redigera

Dela via


HostingEnvironment.SetCultures Method

Definition

Sets culture information for the current thread.

Overloads

SetCultures()

Sets the current thread to the culture specified in the application configuration file.

SetCultures(String)

Sets the current thread to the culture of the specified virtual path.

SetCultures()

Sets the current thread to the culture specified in the application configuration file.

public:
 static IDisposable ^ SetCultures();
public static IDisposable SetCultures ();
static member SetCultures : unit -> IDisposable
Public Shared Function SetCultures () As IDisposable

Returns

An IDisposable object that represents the culture prior to changing; this object can be used to revert to the previous culture.

Remarks

The SetCultures method sets the current thread to the culture specified in the globalization Element (ASP.NET Settings Schema) element in the application's configuration file.

Applies to

SetCultures(String)

Sets the current thread to the culture of the specified virtual path.

public:
 static IDisposable ^ SetCultures(System::String ^ virtualPath);
public static IDisposable SetCultures (string virtualPath);
static member SetCultures : string -> IDisposable
Public Shared Function SetCultures (virtualPath As String) As IDisposable

Parameters

virtualPath
String

The path that contains the culture information.

Returns

An IDisposable object that represents the culture prior to changing; this object can be used to revert to the previous culture.

Remarks

The SetCultures method sets the current thread to the culture that results after applying all elements in the configuration files affecting the specified virtual path.

Applies to