这个要在平板上装应用 然后时时发到电脑上。 或用Eclipse调试工具去取
解决方案 »
- C# 获取重定向页面地址
- 求一个好的设计方法思路
- c# Environment.GetCommandLineArgs() 有什么用
- 求个英语发音(好象是MSTTS )的例子?
- 弱弱的问一下,如何知道MessageBox.Show以后用户点的什么然后执行操作?
- 菜菜鸟一问WINFORM 的treeView控件是如何展开节点的
- Copy() 方法和 Clone() 方法有什么不一样的地方?他们不都是生成复本吗?
- 关于C#中DataSet的问题...
- 杀进程问题
- 怎样在DataGrid中才能得到那些被复选的复选框呢?
- 我的类库中引用了第三方库,想在引用我的库的地方编译之后就把第三方库生成出来
- 求助C#datagridview
应是这个了http://msdn.microsoft.com/en-us/library/windows/desktop/bb760543(v=vs.85).aspx
应是这个了http://msdn.microsoft.com/en-us/library/windows/desktop/bb760543(v=vs.85).aspx这个不太懂啊,帮帮忙啊
Geoposition position = await geoloc.GetGeopositionAsync();//h获得地理坐标
HttpClient httpClient = new HttpClient();
HttpResponseMessage httpResult = await httpClient.GetAsync(String.Format("http://maps.google.com/maps/api/geocode/xml?latlng={0},{1}&language=zh-CN&sensor=false", position.Coordinate.Latitude, position.Coordinate.Longitude));
var resss = await httpResult.Content.ReadAsStringAsync();
XmlDocument xml = new XmlDocument();
xml.LoadXml(resss);
var nr = xml.SelectNodes("GeocodeResponse").First();
var v = nr.SelectNodes("result").OrderBy(d => 1).Skip(3).Take(1).ToList().First();
var t = v.SelectNodes("formatted_address").First().InnerText;
GeoCoordinateWatcher watcher;
private void StartButton_Click(object sender, RoutedEventArgs e)
{
if (watcher == null)
{
//GeoPositionAccuracy.High定义定位的精度水平,Hight表示高
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
//表示定位更新频率,即设定门限值,频率高则耗电高,因为它随时需要定位新的方位
watcher.MovementThreshold = 20;
//状态改变事件,如数据改变,服务停止等
watcher.StatusChanged + = new EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
//位置改变事件,如经度,纬度,海拔等
watcher.PositionChanged + = new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
watcher.Start();
}
}
void watcher_PositionChanged(object sender,
GeoPositionChangedEventArgs<GeoCoordinate> e)
{
Dispatcher.BeginInvoke(() =>
{
//获取纬度坐标
this.LatitudeTextBox.Text = e.Position.Location.Latitude.ToString();
//获取经度坐标
this.LongitudeTextBox.Text = e.Position.Location.Longitude.ToString();
});
}
void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
{
Dispatcher.BeginInvoke(() =>
{
StatusTextBox.Text = e.Status.ToString();
});
}