在UWP示例应用中访问GPS的错误 [英] Errors accessing GPS in UWP Example app

查看:86
本文介绍了在UWP示例应用中访问GPS的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是C#的新手(但熟悉C ++)我一直在为绝对的初学者关注Bob Tabor的Windows 10开发。

I'm new to C# (but familiar with C++) I've been following Bob Tabor's Windows 10 development for absolute beginners.

我在第60课涵盖了支持GPS的UWP天气应用程序。 我正在使用VS2017 运行Win10 Pro Fall Creators Update的核心i7 PC上的Community Edition。有问题的代码是:

I'm on lesson 60 which covers a GPS enabled UWP weather app.  I'm using VS2017  Community Edition on a core i7 PC running Win10 Pro Fall Creators Update. THe code in question is:

  var position = await LocationManager.GetPosition();

            var lat = position.Coordinate.Latitude;
            var lon = position.Coordinate.Longitude;

代码编译正常,但在lat和amp; lon lines我收到以下消息:

The code compiles OK, but on both the lat & lon lines I get the following message:

使用Point.Position.Latitude的建议似乎是合理的,但是以下消息'Point'不包含'Position'的定义意味着它不是答案。

The suggestion to use Point.Position.Latitude seems reasonable, but the following message 'Point' does not contain a definition for 'Position' means that's not the answer.

显然示例代码需要更新,但与此同时,什么是正确的代码来访问GPS坐标。

Obviously the example code needs updating, but in the meantime, what's the correct code to access the GPS co-ordinates.

我有一个应用程序需要使用GPS。

I have an app in mind which will require the use of GPS.

推荐答案

Hello Davdi_J_D,

Hello Davdi_J_D,

你的问题与UWP有关,我会动该论坛提供适当的支持,以及 UWP 论坛。如果您在使用C#时遇到一些语法或代码错误,请随时联系我们
。我们会尽力为您提供解决方案。

your question is more related to UWP , I will move the thread to UWP forum for suitable support. If you have some grammar or code errors in using C#, please feel free to contact us. We will try our best to give you a solution.

最好的问候,

Neil Hu


这篇关于在UWP示例应用中访问GPS的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆