RegionInfo.GeoId 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得地區、國家、縣市或位置的唯一識別碼。
public:
virtual property int GeoId { int get(); };
public virtual int GeoId { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public virtual int GeoId { get; }
member this.GeoId : int
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.GeoId : int
Public Overridable ReadOnly Property GeoId As Integer
屬性值
32 位元帶正負號的數字,專門識別地理位置。
- 屬性
範例
下列程式代碼範例示範 GeoId 屬性。
// 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
'
備註
應用程式應該使用 GeoId 屬性來為客戶提供特定文化特性的服務。 例如, GeoId 屬性可用來做為索引鍵來存取資料庫記錄,其中包含國家/地區的特定資訊。
這個屬性值會對應至 Windows GetUserGeoID
函式。 如需地理標識碼的清單,請參閱 地理位置數據表。