asp.net-mvc 视图中的当前请求文化
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4724429/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
current culture of request in a view
提问by Trimack
How can I acquire the CultureInfo
of a request in a View?
如何获取CultureInfo
视图中的请求?
回答by Matthew Abbott
CultureInfo.CurrentCulture
will return the culture for the thread currently processing the request. This is also accessible through System.Threading.Thread.CurrentCulture
. Are you having a specific issue?
CultureInfo.CurrentCulture
将返回当前处理请求的线程的文化。这也可以通过System.Threading.Thread.CurrentCulture
. 你有什么具体问题吗?
回答by Waqas Raja
you can get CultureInfo by System.Threading.Thread.CurrentThread.CurrentCulture
您可以通过 System.Threading.Thread.CurrentThread.CurrentCulture 获取 CultureInfo