Accessing A CultureInfo setting (locale)?
If I set a user's culture info in Global.asax such that strCulture is the locale "en-US":
System.Threading.Thread.CurrentThread.Curre开发者_JS百科ntCulture
= new System.Globalization.CultureInfo(strCulture);
System.Threading.Thread.CurrentThread.CurrentUICulture
= new System.Globalization.CultureInfo(strCulture);
then how do I access the culture i set elsewhere in the application (after login)?
Thanks.
I spent much consideration before posting this as well, but as Peter mentioned earlier in the comment I can't really come up with a better way then using CurrentUICulture
.
CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
If that's not what you are looking for, please give us more information. :)
精彩评论