System.Device.Location 命名空間

System.Device.Location 命名空間可讓應用程式開發人員使用單一 API 輕鬆存取電腦位置。 The System.Device.Location namespace allows application developers to easily access the computer's location by using a single API. 位置資訊可能來自於多個提供者,例如 GPS、Wi-Fi 三角定位以及手機基地台三角定位。 Location information may come from multiple providers, such as GPS, Wi-Fi triangulation, and cell phone tower triangulation. System.Device.Location 類別可提供單一 API,這個 API 會封裝電腦上的多個位置提供者,並在其間支援平順的設定優先權和轉換作業。 The System.Device.Location classes provide a single API to encapsulate the multiple location providers on a computer and support seamless prioritization and transitioning between them. 因此,使用這個 API 的應用程式開發人員不需要修改應用程式以適應特定的硬體組態。 As a result, application developers who use this API do not need to tailor applications to specific hardware configurations.

類別

CivicAddress

表示實體地址。Represents a civic address. 實體地址可以包含如街道地址、郵遞區號、省份及國家或地區等欄位。A civic address can include fields such as street address, postal code, state/province, and country or region.

CivicAddressResolver

提供將座標位置解析成實體地址的功能。Provides functionality for resolving a coordinate-based location to a civic address.

GeoCoordinate

表示緯度與經度座標所決定的地理位置。Represents a geographical location that is determined by latitude and longitude coordinates. 也可能包含高度、精確度、速度和路線等資訊。May also include altitude, accuracy, speed, and course information.

GeoCoordinateWatcher

提供以緯度與經度座標為根據的位置資料。Supplies location data that is based on latitude and longitude coordinates.

GeoPosition<T>

包含 GeoPosition<T> 類別之型別參數所指定的型別位置資料。Contains location data of a type specified by the type parameter of the GeoPosition<T> class.

GeoPositionChangedEventArgs<T>

提供 PositionChanged 事件的資料。Provides data for the PositionChanged event.

GeoPositionStatusChangedEventArgs

包含 GeoPositionStatusChanged 事件的資料。Contains data for a GeoPositionStatusChanged event.

ResolveAddressCompletedEventArgs

提供 ResolveAddressCompleted 事件的資料。Provides data for the ResolveAddressCompleted event.

介面

ICivicAddressResolver

提供方法,以便在實作時將緯度/經度位置解析成實體地址。Provides a method that when implemented, resolves a latitude/longitude location to a civic address.

IGeoPositionWatcher<T>

可加以實作供存取位置資料及接收位置更新之用的介面。Interface that can be implemented for providing accessing location data and receiving location updates.

列舉

GeoPositionAccuracy

指定應用程式使用之位置資料的已要求精確性層級。Specifies the requested accuracy level for the location data that the application uses.

GeoPositionPermission

表示呼叫應用程式是否可以存取位置資料。Indicates whether the calling application has permission to access location data.

GeoPositionStatus

表示目前位置提供者提供位置更新的能力。Indicates the ability of the location provider to provide location updates.

備註

GeoCoordinateWatcher類別會提供以緯度和經度座標為基礎的位置資料。The GeoCoordinateWatcher class supplies location data that is based on latitude and longitude coordinates. CivicAddressResolverICivicAddressResolver類型提供從座標位置解析為市政位址的能力。The CivicAddressResolver and ICivicAddressResolver types provide the ability to resolve from a coordinate location to a civic address. 此外, IGeoPositionWatcher<T>介面也可以實作為擴充所提供的位置資料類型。Additionally, the IGeoPositionWatcher<T> interface can be implemented to extend the types of location data that are supplied.

在 Windows 7 中, 如果System.Device.Location已安裝位置提供者, 而且可以判斷電腦的位置, 所有類別皆可完全正常運作。In Windows 7, all the System.Device.Location classes are fully functional if a location provider is installed and can determine the computer's location. 在 Windows 7 Starter Edition 中, 可在 [控制台] 中設定的預設位置提供者是唯一支援的位置提供者。On Windows 7 Starter Edition, the Default Location Provider that can be set in Control Panel is the only location provider that is supported.

注意在 Windows 7 之前的 Windows 版本中, 適用下列條件:Note In versions of Windows prior to Windows 7, the following conditions apply: