2011-07-01 139 views
2

如果我設置在Global.asax中用戶的文化信息,使得strCulture是語言環境「EN-US」:訪問CultureInfo設置(區域設置)?

System.Threading.Thread.CurrentThread.CurrentCulture 
    = new System.Globalization.CultureInfo(strCulture); 

System.Threading.Thread.CurrentThread.CurrentUICulture 
    = new System.Globalization.CultureInfo(strCulture); 

那我怎麼進入文化我在其他地方設置的應用程序(登錄後)?

謝謝。

+3

它不清楚你什麼時候設置它,也不知道你是什麼意思的「其他地方」。我認爲有一些原因,它不是'System.Threading.Thread.CurrentThread.CurrentCulture'的明顯答案? –

回答

3

我在發表這篇文章之前花了很多心思,但正如Peter在評論中提到的那樣,我不能想出更好的方法,然後使用CurrentUICulture

CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture; 

如果這不是你正在尋找的,請給我們更多的信息。 :)