HostingEnvironment.SetCultures Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈