CultureInfo.ThreeLetterISOLanguageName 屬性 - Microsoft ...

文章推薦指數: 80 %
投票人數:10人

取得目前CultureInfo 的語言的ISO 639-2 三個字母代碼。

... 這個範例顯示舊的zh-CHS 和zh-CHT 文化特性名稱,其文化特性識別項分別是0x0004 和0x7C04。

跳到主要內容 已不再支援此瀏覽器。

請升級至MicrosoftEdge,以利用最新功能、安全性更新和技術支援。

下載MicrosoftEdge 其他資訊 目錄 結束焦點模式 語言 儲存 編輯 共用 Twitter LinkedIn Facebook 電子郵件 WeChat 目錄 語言 CultureInfo.ThreeLetterISOLanguageName屬性 定義 命名空間: System.Globalization 組件:System.Runtime.dll 組件:mscorlib.dll,netstandard.dll 組件:mscorlib.dll 組件:netstandard.dll 本文內容 取得目前CultureInfo的語言的ISO639-2三個字母代碼。

GetstheISO639-2three-lettercodeforthelanguageofthecurrentCultureInfo. public: virtualpropertySystem::String^ThreeLetterISOLanguageName{System::String^get();}; publicvirtualstringThreeLetterISOLanguageName{get;} memberthis.ThreeLetterISOLanguageName:string PublicOverridableReadOnlyPropertyThreeLetterISOLanguageNameAsString 屬性值 String 目前CultureInfo的語言的ISO639-2三個字母代碼。

TheISO639-2three-lettercodeforthelanguageofthecurrentCultureInfo. 範例 下列程式碼範例會顯示中性文化特性的數個屬性。

Thefollowingcodeexampledisplaysseveralpropertiesoftheneutralcultures. 注意 這個範例顯示舊的zh-CHS和zh-CHT文化特性名稱,其文化特性識別項分別是0x0004和0x7C04。

Theexampledisplaystheolderzh-CHSandzh-CHTculturenameswiththe0x0004and0x7C04cultureidentifiers,respectively.不過,您的WindowsVista應用程式應該使用zh-Hans名稱,而不是zh-CHS和zhzh-hant名稱,而不是zh-CHT。

However,yourWindowsVistaapplicationsshouldusethezh-Hansnameinsteadofzh-CHSandthezh-Hantnameinsteadofzh-CHT.Zh-Hans和zh-Zh-hant名稱代表目前的標準,除非您有使用舊名稱的原因,否則應該使用。

Thezh-Hansandzh-Hantnamesrepresentthecurrentstandard,andshouldbeusedunlessyouhaveareasonforusingtheoldernames. usingnamespaceSystem; usingnamespaceSystem::Globalization; intmain() { //Displaysseveralpropertiesoftheneutralcultures. Console::WriteLine("CULTUREISOISOWINDISPLAYNAMEENGLISHNAME"); System::Collections::IEnumerator^enum0=CultureInfo::GetCultures(CultureTypes::NeutralCultures)->GetEnumerator(); while(enum0->MoveNext()) { CultureInfo^ci=safe_cast(enum0->Current); Console::Write("{0,-7}",ci->Name); Console::Write("{0,-3}",ci->TwoLetterISOLanguageName); Console::Write("{0,-3}",ci->ThreeLetterISOLanguageName); Console::Write("{0,-3}",ci->ThreeLetterWindowsLanguageName); Console::Write("{0,-40}",ci->DisplayName); Console::WriteLine("{0,-40}",ci->EnglishName); } } /* Thiscodeproducesthefollowingoutput.Thisoutputhasbeencroppedforbrevity. CULTUREISOISOWINDISPLAYNAMEENGLISHNAME arararaARAArabicArabic bgbgbulBGRBulgarianBulgarian cacacatCATCatalanCatalan zh-HanszhzhoCHSChinese(Simplified)Chinese(Simplified) cscscesCSYCzechCzech dadadanDANDanishDanish dededeuDEUGermanGerman elelellELLGreekGreek enenengENUEnglishEnglish esesspaESPSpanishSpanish fififinFINFinnishFinnish zhzhzhoCHSChineseChinese zh-HantzhzhoCHTChinese(Traditional)Chinese(Traditional) zh-CHSzhzhoCHSChinese(Simplified)LegacyChinese(Simplified)Legacy zh-CHTzhzhoCHTChinese(Traditional)LegacyChinese(Traditional)Legacy */ usingSystem; usingSystem.Globalization; publicclassSamplesCultureInfo { publicstaticvoidMain() { //Displaysseveralpropertiesoftheneutralcultures. Console.WriteLine("CULTUREISOISOWINDISPLAYNAMEENGLISHNAME"); foreach(CultureInfociinCultureInfo.GetCultures(CultureTypes.NeutralCultures)) { Console.Write("{0,-7}",ci.Name); Console.Write("{0,-3}",ci.TwoLetterISOLanguageName); Console.Write("{0,-3}",ci.ThreeLetterISOLanguageName); Console.Write("{0,-3}",ci.ThreeLetterWindowsLanguageName); Console.Write("{0,-40}",ci.DisplayName); Console.WriteLine("{0,-40}",ci.EnglishName); } } } /* Thiscodeproducesthefollowingoutput.Thisoutputhasbeencroppedforbrevity. CULTUREISOISOWINDISPLAYNAMEENGLISHNAME arararaARAArabicArabic bgbgbulBGRBulgarianBulgarian cacacatCATCatalanCatalan zh-HanszhzhoCHSChinese(Simplified)Chinese(Simplified) cscscesCSYCzechCzech dadadanDANDanishDanish dededeuDEUGermanGerman elelellELLGreekGreek enenengENUEnglishEnglish esesspaESPSpanishSpanish fififinFINFinnishFinnish zhzhzhoCHSChineseChinese zh-HantzhzhoCHTChinese(Traditional)Chinese(Traditional) zh-CHSzhzhoCHSChinese(Simplified)LegacyChinese(Simplified)Legacy zh-CHTzhzhoCHTChinese(Traditional)LegacyChinese(Traditional)Legacy */ ImportsSystem.Globalization ModuleModule1 PublicSubMain() 'Displaysseveralpropertiesoftheneutralcultures. Console.WriteLine("CULTUREISOISOWINDISPLAYNAMEENGLISHNAME") DimciAsCultureInfo ForEachciInCultureInfo.GetCultures(CultureTypes.NeutralCultures) Console.Write("{0,-7}",ci.Name) Console.Write("{0,-3}",ci.TwoLetterISOLanguageName) Console.Write("{0,-3}",ci.ThreeLetterISOLanguageName) Console.Write("{0,-3}",ci.ThreeLetterWindowsLanguageName) Console.Write("{0,-40}",ci.DisplayName) Console.WriteLine("{0,-40}",ci.EnglishName) Nextci EndSub 'Thiscodeproducesthefollowingoutput.Thisoutputhasbeencroppedforbrevity. ' 'CULTUREISOISOWINDISPLAYNAMEENGLISHNAME 'arararaARAArabicArabic 'bgbgbulBGRBulgarianBulgarian 'cacacatCATCatalanCatalan 'zh-HanszhzhoCHSChinese(Simplified)Chinese(Simplified) 'cscscesCSYCzechCzech 'dadadanDANDanishDanish 'dededeuDEUGermanGerman 'elelellELLGreekGreek 'enenengENUEnglishEnglish 'esesspaESPSpanishSpanish 'fififinFINFinnishFinnish 'zhzhzhoCHSChineseChinese 'zh-HantzhzhoCHTChinese(Traditional)Chinese(Traditional) 'zh-CHSzhzhoCHSChinese(Simplified)LegacyChinese(Simplified)Legacy 'zh-CHTzhzhoCHTChinese(Traditional)LegacyChinese(Traditional)Legacy EndModule 備註 例如,英文的三個字母縮寫是「eng」。

Forexample,thethree-letterabbreviationforEnglishis"eng". 注意 在進程或保存資料之間進行通訊時,通常最好是使用完整的CultureInfo.Name。

WhencommunicatingbetweenprocessesorpersistingdataitisusuallybettertousethefullCultureInfo.Name.只使用語言可能會遺失內容和資料。

Usingjustthelanguagecanlosecontextanddata. 適用於 另請參閱 Name DisplayName NativeName EnglishName TwoLetterISOLanguageName ThreeLetterWindowsLanguageName 此頁面有所助益嗎? 請為您的體驗評分 Yes No 還有其他意見反應嗎? 系統會將意見反應傳送給Microsoft:按下[提交]按鈕,您的意見反應將用來改善Microsoft產品和服務。

隱私權原則。

送出 謝謝。

本文內容



請為這篇文章評分?