RegionInfo クラス

定義

国/地域に関する情報が含まれます。

public ref class RegionInfo
public class RegionInfo
[System.Serializable]
public class RegionInfo
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class RegionInfo
type RegionInfo = class
[<System.Serializable>]
type RegionInfo = class
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type RegionInfo = class
Public Class RegionInfo
継承
RegionInfo
属性

注釈

この API の詳細については、「 RegionInfo の補足 API 解説」を参照してください。

次の例では、 RegionInfo クラスのいくつかのメンバーを示します。

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.

*/
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

End Class


'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.

コンストラクター

名前 説明
RegionInfo(Int32)

指定したカルチャ識別子に関連付けられている国/地域に基づいて、 RegionInfo クラスの新しいインスタンスを初期化します。

RegionInfo(String)

名前で指定された国/地域または特定のカルチャに基づいて、 RegionInfo クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
CurrencyEnglishName

国/地域で使用される通貨の名前 (英語) を取得します。

CurrencyNativeName

国/地域のネイティブ言語で書式設定された、国/地域で使用される通貨の名前を取得します。

CurrencySymbol

国/地域に関連付けられている通貨記号を取得します。

CurrentRegion

現在のスレッドで使用されている国/地域を表す RegionInfo を取得します。

DisplayName

ローカライズされたバージョンの .NET の言語の国/地域の完全な名前を取得します。

EnglishName

国/地域の完全な名前を英語で取得します。

GeoId

地理的な地域、国、市区町村、または場所の一意の識別番号を取得します。

IsMetric

国/地域が測定にメトリック システムを使用するかどうかを示す値を取得します。

ISOCurrencySymbol

国/地域に関連付けられている 3 文字の ISO 4217 通貨記号を取得します。

Name

現在の RegionInfo オブジェクトの名前または ISO 3166 の 2 文字の国/地域コードを取得します。

NativeName

国/地域のネイティブ言語で書式設定された国/地域の名前を取得します。

ThreeLetterISORegionName

国/地域の ISO 3166 で定義されている 3 文字のコードを取得します。

ThreeLetterWindowsRegionName

この RegionInfo によって表される国/地域にWindowsによって割り当てられた 3 文字のコードを取得します。

TwoLetterISORegionName

国/地域の ISO 3166 で定義されている 2 文字のコードを取得します。

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在の RegionInfoと同じインスタンスであるかどうかを判断します。

GetHashCode()

現在の RegionInfoのハッシュ関数として機能し、ハッシュ アルゴリズムやハッシュ テーブルなどのデータ構造に適しています。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在の RegionInfoに指定されたカルチャ名または ISO 3166 の 2 文字の国/地域コードを含む文字列を返します。

適用対象

こちらもご覧ください