RegionInfo.NativeName Propriété

Définition

Obtient le nom d'un pays/région mis en forme dans la langue native du pays/région.

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

Valeur de propriété

Nom natif du pays ou de la région mis en forme dans la langue associée au code de pays ou de région ISO 3166.

Attributs

Exemples

L’exemple de code suivant illustre la NativeName propriété .

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

Remarques

Notes

La NativeName propriété récupère un nom de culture complet si l’objet est construit à l’aide RegionInfo d’un nom de culture complet.

Nous vous recommandons d’utiliser le nom de culture ( par exemple, « en-US » pour l’anglais (États-Unis) pour accéder à la NativeName propriété. La chaîne utilisée pour cette propriété dépend de la langue associée au pays/à la région. Par exemple, les noms en-US de culture pour l’anglais (États-Unis) et es-US pour l’espagnol (États-Unis) peuvent récupérer des valeurs différentes sur Windows Vista. Par conséquent, la création de l’objet RegionInfo avec uniquement un nom de pays/région de n’est US pas suffisamment spécifique pour distinguer la chaîne appropriée.

S’applique à