|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: May 2010
Messaggi: 126
|
[C#]Device Location
Ciao ragazzi ho un problema a riconoscere l'indirizzo con il metodo ResolveAddress()
Qui il codice: Codice:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Device.Location;
namespace prova
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
GeoCoordinateWatcher watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);//determina le coordinate
watcher.MovementThreshold = 1.0;
watcher.TryStart(false, TimeSpan.FromMilliseconds(1000));
CivicAddressResolver resolver = new CivicAddressResolver();
if (watcher.Position.Location.IsUnknown == false)//fin qui va bene
{
CivicAddress address = resolver.ResolveAddress(watcher.Position.Location);
if (!address.IsUnknown)
{
MessageBox.Show("indirizzo conosciuto");
}
else
MessageBox.Show("Sconosciuto");
}
}
}
}
__________________
Il mio pc: Scheda madre:MSI Amethyst-m; Processore:amd sempron 3400+;2000Mhz Ram:ddr-sdram 1024Mb; Scheda grafica:Nvidia geforce 6200SE Turbocache; Scheda audio:AC'97 Audio controller Sistema Operativo:Windows 7 32bit |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Sep 2004
Messaggi: 3967
|
beh, se salta il secondo è perchè "address" resta sconosciuto.
e forse una risposta puoi trovarla qui: http://stackoverflow.com/questions/3...d-civicaddress
__________________
Dai wafer di silicio nasce: LoHacker... il primo biscotto Geek
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 02:13.



















