共用方式為


RegionInfo.CurrencyNativeName 屬性

定義

取得國家/地區中使用的貨幣名稱 (以國家/地區的母語格式表示)。

public:
 virtual property System::String ^ CurrencyNativeName { System::String ^ get(); };
public virtual string CurrencyNativeName { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public virtual string CurrencyNativeName { get; }
member this.CurrencyNativeName : string
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.CurrencyNativeName : string
Public Overridable ReadOnly Property CurrencyNativeName As String

屬性值

國家/地區中使用之貨幣的原生名稱 (以與 ISO 3166 國家/地區碼相關聯的語言格式表示)。

屬性

範例

下列程式代碼範例示範 CurrencyNativeName 屬性。

// This example demonstrates the RegionInfo.EnglishName, NativeName,
// CurrencyEnglishName, CurrencyNativeName, and GeoId properties.

using namespace System;
using namespace System::Globalization;

int main()
{
    // Regional Info for Sweden
    RegionInfo^ ri = gcnew RegionInfo("SE");

    Console::WriteLine("Region English Name: . . . {0}", ri->EnglishName);
    Console::WriteLine("Native Name: . . . . . . . {0}", ri->NativeName);
    Console::WriteLine("Currency English Name: . . {0}",
        ri->CurrencyEnglishName);
    Console::WriteLine("Currency Native Name:. . . {0}",
        ri->CurrencyNativeName);
    Console::WriteLine("Geographical ID: . . . . . {0}", ri->GeoId);
}
/*
This code example produces the following results:

Region English Name: . . . Sweden
Native Name: . . . . . . . Sverige
Currency English Name: . . Swedish Krona
Currency Native Name:. . . Svensk krona
Geographical ID: . . . . . 221

*/
// This example demonstrates the RegionInfo.EnglishName, NativeName,
// CurrencyEnglishName, CurrencyNativeName, and GeoId properties.

using System;
using System.Globalization;

class Sample
{
    public static void Main()
    {
    RegionInfo ri = new RegionInfo("SE"); // Sweden

    Console.WriteLine("Region English Name: . . . {0}", ri.EnglishName);
    Console.WriteLine("Native Name: . . . . . . . {0}", ri.NativeName);
    Console.WriteLine("Currency English Name: . . {0}", ri.CurrencyEnglishName);
    Console.WriteLine("Currency Native Name:. . . {0}", ri.CurrencyNativeName);
    Console.WriteLine("Geographical ID: . . . . . {0}", ri.GeoId);
    }
}
/*
This code example produces the following results:

Region English Name: . . . Sweden
Native Name: . . . . . . . Sverige
Currency English Name: . . Swedish Krona
Currency Native Name:. . . Svensk krona
Geographical ID: . . . . . 221

*/
' This example demonstrates the RegionInfo.EnglishName, NativeName,
' CurrencyEnglishName, CurrencyNativeName, and GeoId properties.
Imports System.Globalization

Class Sample
   Public Shared Sub Main()
      Dim ri As New RegionInfo("SE") ' Sweden
      Console.WriteLine("Region English Name: . . . {0}", ri.EnglishName)
      Console.WriteLine("Native Name: . . . . . . . {0}", ri.NativeName)
      Console.WriteLine("Currency English Name: . . {0}", ri.CurrencyEnglishName)
      Console.WriteLine("Currency Native Name:. . . {0}", ri.CurrencyNativeName)
      Console.WriteLine("Geographical ID: . . . . . {0}", ri.GeoId)
   End Sub
End Class
'
'This code example produces the following results:
'
'Region English Name: . . . Sweden
'Native Name: . . . . . . . Sverige
'Currency English Name: . . Swedish Krona
'Currency Native Name:. . . Svensk krona
'Geographical ID: . . . . . 221
'

備註

如果使用特定文化特性建立目前的 RegionInfo 物件,且對應國家/地區使用多個語言,則 CurrencyNativeName 屬性會擷取與特定文化特性相關聯的貨幣名稱。

此屬性的值取決於與特定國家/地區相關聯的語言。 因此,如果您想要使用 CurrencyNativeName 屬性,您應該藉由傳遞RegionInfo(String)建構函式結合的語言和國家/地區程式代碼來具現化RegionInfo物件。 例如,如果 RegionInfo 物件是以英文 (加拿大) 之 「en-CA」 的合併語言和國家/地區代碼具現化,其 CurrencyNativeName 屬性值為 「Canada Dollar」。。 如果使用法文 (加拿大) 之 “fr-CA” 的合併語言和國家/地區代碼具現化,其 CurrencyNativeName 屬性值為 “Dollar canadien”。 因此,在此案例中,只建立 RegionInfo 只有國家/地區名稱 (“CA” 的物件,) 不足以區分適當的原生貨幣名稱。

適用於