RegionInfo クラス
アセンブリ: mscorlib (mscorlib.dll 内)


CultureInfo とは対照的に、RegionInfo はユーザーの設定を表さず、ユーザーの言語またはカルチャに依存しません。
RegionInfo 名は、ISO 3166 で国/地域に対して定義されている 2 文字のコードのいずれかになります。大文字と小文字の区別は特に重要ではありませんが、Name、TwoLetterISORegionName、ThreeLetterISORegionName の各プロパティは、対応するコードを大文字で返します。
このクラスと System.Globalization 名前空間のその他のクラスで受け入れられ、使用される定義済み RegionInfo 名の一覧は、次のとおりです。
国/地域 | ||
---|---|---|
ARE | ||
AM | ||
AT | ||
BY | ||
CAN | ||
DO | DOM | |
IN | ||
IS | ||
IT | ||
MY | ||
NO | NOR | |
PER | ||
THA | ||
US | ||
ISOCurrencySymbol プロパティが返す ISO 4217 通貨記号の一覧を次に示します。

RegionInfo クラスのいくつかのメンバの使用例を次に示します。
Imports System Imports System.Globalization Public Class SamplesRegionInfo Public Shared Sub Main() ' Displays the property values of the RegionInfo for "US". Dim myRI1 As New RegionInfo("US") Console.WriteLine(" Name: {0}", myRI1.Name) Console.WriteLine(" DisplayName: {0}", myRI1.DisplayName) Console.WriteLine(" EnglishName: {0}", myRI1.EnglishName) Console.WriteLine(" IsMetric: {0}", myRI1.IsMetric) Console.WriteLine(" ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName) Console.WriteLine(" ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName) Console.WriteLine(" TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName) Console.WriteLine(" CurrencySymbol: {0}", myRI1.CurrencySymbol) Console.WriteLine(" ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol) Console.WriteLine() ' Compares the RegionInfo above with another RegionInfo created using CultureInfo. Dim myRI2 As New RegionInfo(New CultureInfo("en-US", False).LCID) If myRI1.Equals(myRI2) Then Console.WriteLine("The two RegionInfo instances are equal.") Else Console.WriteLine("The two RegionInfo instances are NOT equal.") End If End Sub 'Main End Class 'SamplesRegionInfo 'This code produces the following output. ' ' Name: US ' DisplayName: United States ' EnglishName: United States ' IsMetric: False ' ThreeLetterISORegionName: USA ' ThreeLetterWindowsRegionName: USA ' TwoLetterISORegionName: US ' CurrencySymbol: $ ' ISOCurrencySymbol: USD ' 'The two RegionInfo instances are equal.
using System; using System.Globalization; public class SamplesRegionInfo { public static void Main() { // Displays the property values of the RegionInfo for "US". RegionInfo myRI1 = new RegionInfo( "US" ); Console.WriteLine( " Name: {0}", myRI1.Name ); Console.WriteLine( " DisplayName: {0}", myRI1.DisplayName ); Console.WriteLine( " EnglishName: {0}", myRI1.EnglishName ); Console.WriteLine( " IsMetric: {0}", myRI1.IsMetric ); Console.WriteLine( " ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName ); Console.WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName ); Console.WriteLine( " TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName ); Console.WriteLine( " CurrencySymbol: {0}", myRI1.CurrencySymbol ); Console.WriteLine( " ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol ); Console.WriteLine(); // Compares the RegionInfo above with another RegionInfo created using CultureInfo. RegionInfo myRI2 = new RegionInfo( new CultureInfo("en-US",false).LCID ); if ( myRI1.Equals( myRI2 ) ) Console.WriteLine( "The two RegionInfo instances are equal." ); else Console.WriteLine( "The two RegionInfo instances are NOT equal." ); } } /* This code produces the following output. Name: US DisplayName: United States EnglishName: United States IsMetric: False ThreeLetterISORegionName: USA ThreeLetterWindowsRegionName: USA TwoLetterISORegionName: US CurrencySymbol: $ ISOCurrencySymbol: USD The two RegionInfo instances are equal. */
using namespace System; using namespace System::Globalization; int main() { // Displays the property values of the RegionInfo for "US". RegionInfo^ myRI1 = gcnew RegionInfo( "US" ); Console::WriteLine( " Name: {0}", myRI1->Name ); Console::WriteLine( " DisplayName: {0}", myRI1->DisplayName ); Console::WriteLine( " EnglishName: {0}", myRI1->EnglishName ); Console::WriteLine( " IsMetric: {0}", myRI1->IsMetric ); Console::WriteLine( " ThreeLetterISORegionName: {0}", myRI1->ThreeLetterISORegionName ); Console::WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName ); Console::WriteLine( " TwoLetterISORegionName: {0}", myRI1->TwoLetterISORegionName ); Console::WriteLine( " CurrencySymbol: {0}", myRI1->CurrencySymbol ); Console::WriteLine( " ISOCurrencySymbol: {0}", myRI1->ISOCurrencySymbol ); Console::WriteLine(); // Compares the RegionInfo above with another RegionInfo created using CultureInfo. RegionInfo^ myRI2 = gcnew RegionInfo( (gcnew CultureInfo( "en-US",false ))->LCID ); if ( myRI1->Equals( myRI2 ) ) Console::WriteLine( "The two RegionInfo instances are equal." ); else Console::WriteLine( "The two RegionInfo instances are NOT equal." ); } /* This code produces the following output. Name: US DisplayName: United States EnglishName: United States IsMetric: False ThreeLetterISORegionName: USA ThreeLetterWindowsRegionName: USA TwoLetterISORegionName: US CurrencySymbol: $ ISOCurrencySymbol: USD The two RegionInfo instances are equal. */
import System.*; import System.Globalization.*; public class SamplesRegionInfo { public static void main(String[] args) { // Displays the property values of the RegionInfo for "US". RegionInfo myRI1 = new RegionInfo("US"); Console.WriteLine(" Name: {0}", myRI1.get_Name()); Console.WriteLine(" DisplayName: {0}", myRI1.get_DisplayName()); Console.WriteLine(" EnglishName: {0}", myRI1.get_EnglishName()); Console.WriteLine(" IsMetric: {0}", System.Convert.ToString( myRI1.get_IsMetric())); Console.WriteLine(" ThreeLetterISORegionName: {0}", myRI1.get_ThreeLetterISORegionName()); Console.WriteLine(" ThreeLetterWindowsRegionName: {0}", myRI1.get_ThreeLetterWindowsRegionName()); Console.WriteLine(" TwoLetterISORegionName: {0}", myRI1.get_TwoLetterISORegionName()); Console.WriteLine(" CurrencySymbol: {0}", myRI1.get_CurrencySymbol()); Console.WriteLine(" ISOCurrencySymbol: {0}", myRI1.get_ISOCurrencySymbol()); Console.WriteLine(); // Compares the RegionInfo above with another RegionInfo // created using CultureInfo. RegionInfo myRI2 = new RegionInfo((new CultureInfo("en-US", false)).get_LCID()); if ( myRI1.Equals(myRI2)) { Console.WriteLine("The two RegionInfo instances are equal."); } else { Console.WriteLine("The two RegionInfo instances are NOT equal."); } } //main } //SamplesRegionInfo /* This code produces the following output. Name: US DisplayName: United States EnglishName: United States IsMetric: False ThreeLetterISORegionName: USA ThreeLetterWindowsRegionName: USA TwoLetterISORegionName: US CurrencySymbol: $ ISOCurrencySymbol: USD The two RegionInfo instances are equal. */

System.Globalization.RegionInfo


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からRegionInfo クラスを検索する場合は、下記のリンクをクリックしてください。

- RegionInfo クラスのページへのリンク