Definición

Obtiene o establece la dirección en grados, con respecto al norte verdadero.Gets or sets the heading in degrees, relative to true north.

``````public:
property double Course { double get(); void set(double value); };``````
``public double Course { get; set; }``
``member this.Course : double with get, set``
``Public Property Course As Double``

Double

Excepciones

Course está fuera del intervalo válido.Course is set outside the valid range.

Ejemplos

En el siguiente ejemplo se imprimen las Course Speed propiedades y de la propiedad de la ubicación actual GeoCoordinate .The following example prints the Course and Speed properties of the current location's GeoCoordinate.

``````static void GetLocationCourseAndSpeed()
{
GeoCoordinateWatcher watcher = new GeoCoordinateWatcher();

watcher.TryStart(true, TimeSpan.FromMilliseconds(1000));

if (watcher.Position.Location.IsUnknown != true)
{
GeoCoordinate coord = watcher.Position.Location;

Console.WriteLine("Course: {0}, Speed: {1}",
coord.Course,
coord.Speed);
}
else
{
Console.WriteLine("Unknown");
}
}
``````
``````
Public Sub GetLocationCourseAndSpeed()
Dim watcher As GeoCoordinateWatcher
watcher = New System.Device.Location.GeoCoordinateWatcher()
watcher.TryStart(False, TimeSpan.FromMilliseconds(1000))

If Not watcher.Position.Location.IsUnknown Then
Dim coord As GeoCoordinate = watcher.Position.Location
Console.WriteLine("Course: {0}, Speed: {1}",
coord.Course,
coord.Speed) 'NaN if not available.
Else
Console.WriteLine("Location unknown.")
End If

End Sub

``````

Comentarios

El intervalo válido incluye valores de 0,0 a 360,0 y `Double.NaN` si el encabezado no está definido.The valid range includes values from 0.0 to 360.0, and `Double.NaN` if the heading is not defined.