RegionInfo.ThreeLetterISORegionName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得為國家/地區定義於 ISO 3166 中的三個字母代碼。
public:
virtual property System::String ^ ThreeLetterISORegionName { System::String ^ get(); };
public virtual string ThreeLetterISORegionName { get; }
member this.ThreeLetterISORegionName : string
Public Overridable ReadOnly Property ThreeLetterISORegionName As String
屬性值
為國家/地區定義於 ISO 3166 中的三個字母代碼。
範例
下列程式代碼範例會顯示 類別的屬性 RegionInfo 。
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 );
}
/*
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
*/
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 );
}
}
/*
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
*/
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)
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
備註
屬性 ThreeLetterISORegionName 包含此國家/地區 ISO 3166 中定義的三個字母代碼。 例如,美國 的三個字母代碼是 “USA”。
案例並不重要。 不過, Name、 TwoLetterISORegionName和 ThreeLetterISORegionName 屬性會以大寫傳回適當的程序代碼。