2011-12-02 58 views
3
Country           A 2  A 3  Number 
---------------------------------------------------------------------- 
BAHAMAS           BS  BHS  044 

該國已經存在,但我無法從.Net API獲取地區和文化信息。如何獲取巴哈馬的地區和文化信息?

RegionInfo r = new RegionInfo("BS"); or RegionInfo r = new RegionInfo("BSH"); 
RegionInfo r = new RegionInfo(44) 
CultureInfo.GetCultureInfo(44) 

問題:如何獲取該國的地區和文化信息?

ISO 3166:http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html

回答

3

這是有趣的,根據Wikipedia,官方語言爲英語與Bahmanian Dialect

在嘗試這些,我們得到了以下錯誤

BHS - the culture is not supported 

(由是你的代碼有BSH,錯字可能)

隨着 「BS」,您將獲得:

**The region name BS should not correspond to neutral culture; a 
specific culture name is required.** 

所以我做了一些研究,針對一種特定的文化,結果爲there is a language subtag巴哈馬克里奧爾語英語這是「bah」

但是 - 這也產生了:

Culture name 'bah-BS' is not supported. 

事實證明,.NET並不支持所有已知的文化區 - 它使用列表here。 (使用3.5鏈接 - 列表消失在4.0版本 - 可能還沒有更新)

不幸的是,你將需要build a custom culture/region for The Bahamas

+0

謝謝你的迴應。 – zzj8704

相關問題