开发者

Thread.CurrentCulture refers to client or server

开发者 https://www.devze.com 2023-01-03 22:02 出处:网络
Where does Thread.CurrentCulture gets it\'s data from? Client (browser) or server. And another question, is this the right w开发者_JAVA百科ay to find out the culture of the user?

Where does Thread.CurrentCulture gets it's data from? Client (browser) or server.

And another question, is this the right w开发者_JAVA百科ay to find out the culture of the user?

Thanks


Thread.CurrentCulture gets the info for the executing thread. ASP.NET code is running on the server; hence, this will give you the current culture of the server thread.

To find the client accepted languages, use HttpRequest.UserLanguages instead.


I assume you mean in an ASP.NET environment? Normally the server culture is returned.

Maybe you can use this article on Auto-Culture Handling in ASP.NET (depending on browser languages): http://msdn.microsoft.com/en-us/magazine/cc163849.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消