hi friends here iam tracking systems latitute and longitude every one hour. i created one exe and installed some systems
iam getting records every one hour if systems are open. some times system is sleeping mode also iam getting two records one hour so.my problem is how to get records every one hour i dnt want to save records when system is sleeping mode
here my code(working every one hr but sleeping mode iam getting two records so can u clarify this one)
if (e.Status == GeoPositionStatus.Ready)
{
// Display the latitude and longitude.
if (Watcher.Position.Location.IsUnknown)
{
//txtLat.Text = "Cannot find location data";
}
else
{
for (; ; )
{
FML fm = new FML();
GeoCoordinate location = Watcher.Position.Location;
var d = location.Latitude.ToString();
var ef = location.Longitude.ToString();
var name = Environment.MachineName;
fm.systemname = Environment.MachineName;
fm.latitude = d;
fm.longitude = ef;
fm.datetime = DateTime.Now;
db.FMLs.InsertOnSubmit(fm);
db.SubmitChanges();
Thread.Sleep(1000 * 60 * 60); // 60 Minutes
}
}
}
4 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Nitin SontakkePosted Feb 22, 2017, 12:51 AM
Suvendu Shekhar GiriPosted Feb 22, 2017, 1:36 AM
Nitin SontakkePosted Feb 22, 2017, 12:54 AM
Suvendu Shekhar GiriPosted Feb 22, 2017, 12:53 AM