2010-04-11 83 views
2

可能重複:
Is there any way to determine text direction from CultureInfo in asp.net?有什麼方法可以在特定文化中獲得書寫方向?

我想編寫一個用戶在我的應用程序中選擇任何一種文化的方向。例如,當我的用戶使用fa-IR文化時,我想獲得rtl,如果選擇en-US,則獲得ltr

在.NET中是否有內置的解決方案?

+1

可能的重複:http://stackoverflow.com/questions/1127773/is-there-any-way-to-determine-text-direction-from-cultureinfo-in-asp-net – 2010-04-11 04:18:20

回答

2

使用TextInfo.IsRightToLeft屬性,以確定這一點:

bool isRightToLeft = new CultureInfo("fa-IR").TextInfo.IsRightToLeft; 

詳見MSDN

相關問題