2010-02-14 41 views

回答

11

你想要像'爲每個區域循環'。

Dim info As CultureInfo 
    For Each info In CultureInfo.GetCultures(CultureTypes.AllCultures) 

     ListBox1.Items.Add(info.EnglishName) 
    Next 

注意到像半秒傾倒語言環境列表到爲ListBox

然後你就可以通過各種方式,如引用「信息」:在

info.NumberFormat 
    info.DateTimeFormat 

獲取今天的日期語言環境日期:

 If Not info.IsNeutralCulture Then 
      Dim dateNow As DateTime = DateTime.Now 
      ListBox1.Items.Add(dateNow.ToString("d", info.DateTimeFormat).ToString) 
     End If 
+0

謝謝。它可以像我需要的那樣工作。 – zendar 2010-02-14 09:34:57

+0

歡迎您。確保使用IsNeutralCulture檢查,否則在轉換語言環境數據時會導致異常。 – 2010-02-14 10:07:47