共用方式為


GeographicRegion 類別

定義

描述區域。 這通常是國家/地區,但可能是宏區域。

public ref class GeographicRegion sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.IGeographicRegionFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class GeographicRegion final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.IGeographicRegionFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class GeographicRegion final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.IGeographicRegionFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class GeographicRegion
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.IGeographicRegionFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class GeographicRegion
function GeographicRegion(geographicRegionCode)
Public NotInheritable Class GeographicRegion
繼承
Object Platform::Object IInspectable GeographicRegion
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

範例

// Get the user's geographic region and its display name.
var geographicRegion = new Windows.Globalization.GeographicRegion();
var displayName = geographicRegion.DisplayName;

備註

如需 Microsoft 所使用的標準國家/地區代碼清單,請參閱 官方國家/地區清單

建構函式

GeographicRegion()

建立預設為使用者主區域的 GeographicRegion 物件。

GeographicRegion(String)

建立 GeographicRegion 物件。

屬性

Code

取得字串,其中包含代表區域的最佳可用識別碼。

CodeThreeDigit

取得這個區域的三位數識別碼,做為字串。

CodeThreeLetter

取得這個區域的三個字母識別碼。

CodeTwoLetter

取得這個區域的兩個字母識別碼。

CurrenciesInUse

取得在此區域中使用的貨幣集合。

DisplayName

取得適合向使用者顯示以識別區域的當地語系化字串。

NativeName

取得這個區域中所說主要語言的區功能變數名稱稱。

方法

IsSupported(String)

判斷是否支援地理區域識別碼。

適用於

另請參閱