Supplies location data that is based on latitude and longitude coordinates.
Assembly: System.Device (in System.Device.dll)
Thetype exposes the following members.
|DesiredAccuracy||The requested accuracy level for the location data that is provided by the .|
|MovementThreshold||The distance that must be moved, in meters, relative to the coordinate from the last PositionChanged event, before the location provider raises another PositionChanged event.|
|Permission||Indicates whether permission to access location data from location providers has been granted or denied.|
|Position||Gets the GeoCoordinate which indicates the current location.|
|Status||Gets the current status of the .|
|Dispose()||Releases all resources that are used by the current instance of the class.|
|Dispose(Boolean)||Releases all resources used by the current instance of the class.|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Frees resources and performs other cleanup operations before the is reclaimed by garbage collection. (Overrides Object.Finalize().)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|OnPositionChanged||Called when a PositionChanged event occurs.|
|OnPositionStatusChanged||Called when a StatusChanged event occurs.|
|OnPropertyChanged||Called when a property of the changes.|
|Start()||Initiate the acquisition of data from the current location provider. This method enables PositionChanged events and allows access to the Position property.|
|Start(Boolean)||Initiate the acquisition of data from the current location provider. This method enables PositionChanged events and allows access to the Position property.|
|Stop||Stops the from providing location data and events.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|TryStart||Initiates the acquisition of data from the current location provider. This method returns synchronously.|
The class supplies coordinate-based location data from the current location provider. The current location provider is prioritized as the highest on the computer, based on a number of factors, such as the age and accuracy of the data from all providers, the accuracy requested by location applications, and the power consumption and performance impact associated with the location provider. The current location provider might change over time, for instance, when a GPS device loses its satellite signal indoors and a Wi-Fi triangulation provider becomes the most accurate provider on the computer.
The Status property can be checked to determine if data is available. If data is available, you can get the location one time from the Position property, or receive continuous location updates by handling the PositionChanged event.
In Windows 7, all the System.Device.Location classes are fully functional if a location provider is installed and able to resolve the computer's location.
On Windows 7 Starter Edition, the only supported location provider is the Default Location Provider in Control Panel, and an add-in must be installed to specify latitude and longitude.
Note In versions of Windows prior to Windows 7, the following conditions apply:
The following program shows how to create a and start acquiring data by using an initialization timeout. The code then prints the coordinates of the location, if known.
The following program shows how to receive continuous location updates by subscribing to PositionChanged events.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.