RegionInfo.NativeName Propiedad

Definición

Obtiene el nombre de un país o región, con el formato del idioma nativo del país o región.

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

Valor de propiedad

String

Nombre nativo del país o región con el formato del idioma asociado al código de país o región ISO 3166.

Atributos

Ejemplos

En el ejemplo de código siguiente se muestra la NativeName propiedad .

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

Comentarios

Nota

La NativeName propiedad recupera un nombre de referencia cultural completo si el objeto se construye con un nombre de referencia RegionInfo cultural completo.

Se recomienda usar el nombre de la referencia cultural ( por ejemplo, "en-US" para inglés (Estados Unidos) - para acceder a la NativeName propiedad . La cadena usada para esta propiedad depende del idioma asociado al país o región. Por ejemplo, los nombres de referencia cultural para inglés (Estados Unidos) y para español (Estados Unidos) pueden recuperar valores diferentes en-US es-US en Windows Vista. Por lo tanto, la creación del objeto con solo un nombre de país o región de no es lo suficientemente específica RegionInfo como para distinguir la cadena US adecuada.

Se aplica a