GeographicRegion 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
描述区域。 这通常是一个国家/地区,但可能是一个宏观区域。
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
- 继承
- 属性
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) |
确定是否支持地理区域标识符。 |