RegionInfo.GeoId Egenskap

Definition

Hämtar ett unikt identifieringsnummer för en geografisk region, ett land, en stad eller en plats.

public:
 virtual property int GeoId { int get(); };
[System.Runtime.InteropServices.ComVisible(false)]
public virtual int GeoId { get; }
public virtual int GeoId { get; }
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.GeoId : int
member this.GeoId : int
Public Overridable ReadOnly Property GeoId As Integer

Egenskapsvärde

Ett 32-bitars signerat nummer som unikt identifierar en geografisk plats.

Attribut

Exempel

Följande kodexempel visar egenskapen GeoId .

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

Kommentarer

Programmet bör använda GeoId egenskapen för att tillhandahålla kulturspecifika tjänster till kunder. Egenskapen kan till exempel GeoId användas som en nyckel för att komma åt en databaspost som innehåller specifik information om ett land/en region.

Det här egenskapsvärdet motsvarar funktionen Windows GetUserGeoID. En lista över geografiska identifierare finns i Tabell över geografiska platser.

Gäller för