本文整理匯總了C#中System.Globalization.CultureInfo.IsNeutralCulture屬性的典型用法代碼示例。如果您正苦於以下問題:C# CultureInfo.IsNeutralCulture屬性的具體用法?C# CultureInfo.IsNeutralCulture怎麽用?C# CultureInfo.IsNeutralCulture使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Globalization.CultureInfo
的用法示例。
在下文中一共展示了CultureInfo.IsNeutralCulture屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
//引入命名空間
using System;
using System.Globalization;
public class SamplesCultureInfo
{
public static void Main()
{
// Lists the cultures that use the Chinese language and determines if each is a neutral culture.
foreach (CultureInfo ci in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
if (ci.TwoLetterISOLanguageName == "zh")
{
Console.Write("{0,-7} {1,-40}", ci.Name, ci.EnglishName);
if (ci.IsNeutralCulture)
{
Console.WriteLine(": neutral");
}
else
{
Console.WriteLine(": specific");
}
}
}
}
}
輸出:
zh-Hans Chinese (Simplified) : neutral zh-TW Chinese (Traditional, Taiwan) : specific zh-CN Chinese (Simplified, PRC) : specific zh-HK Chinese (Traditional, Hong Kong S.A.R.) : specific zh-SG Chinese (Simplified, Singapore) : specific zh-MO Chinese (Traditional, Macao S.A.R.) : specific zh Chinese : neutral zh-Hant Chinese (Traditional) : neutral zh-CHS Chinese (Simplified) Legacy : neutral zh-CHT Chinese (Traditional) Legacy : neutral