GET PC POSITION IN VISUAL BASIC
-
GOOD DAY FRIENDS! Please, is it possible to detect when the pc or laptop position changes using visual basic? Take for instance, if pc was initially located at position A and later moved to position B; then, the application should be able to get the position's changes. In a simplified term, assuming pc was in Lat. 30 and Log. 40, if position changes, then the lat. and log. values should also change. Finally found what I want but it is in javascript. Can anyone convert this to a desktop application in vb.
window.onload = function () { var mapOptions = { center: new google.maps.LatLng(18.9300, 72.8200), zoom: 14, mapTypeId: google.maps.MapTypeId.ROADMAP }; var infoWindow = new google.maps.InfoWindow(); var latlngbounds = new google.maps.LatLngBounds(); var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions); google.maps.event.addListener(map, 'click', function (e) { alert("Latitude: " + e.latLng.lat() + "\\r\\nLongitude: " + e.latLng.lng()); }); }
Thanks in advance!
There are many ways that you can do this, first and foremost has been shared with you through the use of GPS hardware. That will detect the location, and you can then write the program to get the location and show it or process it. However, if you need to get the location of a machine inside the office or a building, you can also possibly use the network interfaces, to determine where the machine is at the moment. Note that, this is very bad in cases where you need to pinpoint location, but changes can be detected easily based on the network or the endpoint from where the machine is communication. And as for Visual Basic, which one? The VB 6? I am unsure, whether you will be able find any solution for that, C++ or C# or Java might do some help in these cases. Even Vb.NET would require some help from C# world. Have a look here, [monitoring - Is it possible to find a computer's physical location in a room? - Server Fault](https://serverfault.com/questions/671781/is-it-possible-to-find-a-computers-physical-location-in-a-room)
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
-
If the machine has inbuilt GPS hardware then yes, probably. If not, you may be able to get a rough location from wifi connection data. Accuracy will be poor though.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Thanks for your response. How can I achieve this your suggestion please?
-
Thanks for your response. How can I achieve this your suggestion please?
Investigate the Google Maps API
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
Investigate the Google Maps API
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Thank you so much for your time of response. Please, I tried reading about google's map api but not getting the flow. It only shows the country as a whole. But what am looking for is, assuming a pc position was lat 30.001 and log. 40.687 and was later shifted from initial position to another. I want the software to update it self with the pc current position. Please help. Once again, thanks.
-
Thank you so much for your time of response. Please, I tried reading about google's map api but not getting the flow. It only shows the country as a whole. But what am looking for is, assuming a pc position was lat 30.001 and log. 40.687 and was later shifted from initial position to another. I want the software to update it self with the pc current position. Please help. Once again, thanks.
-
And how is that software supposed to know when the PC has been moved, or to figure out exactly where it is on the surface of the earth? As has already been mentioned, unless the PC contains a GPS receiver then you cannot do it.
The script posted by me connects to Google Map API and retrieves someone current lat. and log. but it is written in JavaScript.Looking for a way to convert it to VB (VB 6.0 or VB.Net). Any help please.
-
The script posted by me connects to Google Map API and retrieves someone current lat. and log. but it is written in JavaScript.Looking for a way to convert it to VB (VB 6.0 or VB.Net). Any help please.
OK, but Google Maps API does't magically know with any REAL accuracy where the machine is UNLESS IT HAS A GPS RECEIVER. Without that YOU have to tell Google where the machine is. If you rely on any other detection machanism, like Geomapping an IP, it can be off by dozens of miles. Right now, if I don't tell Google explicitly, it'll guess that my machine is 36 miles from where it really is.
System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
The script posted by me connects to Google Map API and retrieves someone current lat. and log. but it is written in JavaScript.Looking for a way to convert it to VB (VB 6.0 or VB.Net). Any help please.
How many times do we need to explain: if you do not have a GPS receiver in the PC no software can find its location. Google maps will only tell you the location of the IP address of your broadband provider. In my case that is some 70 miles from where I live.
-
OK, but Google Maps API does't magically know with any REAL accuracy where the machine is UNLESS IT HAS A GPS RECEIVER. Without that YOU have to tell Google where the machine is. If you rely on any other detection machanism, like Geomapping an IP, it can be off by dozens of miles. Right now, if I don't tell Google explicitly, it'll guess that my machine is 36 miles from where it really is.
System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakThanks for your vital information!
-
There are many ways that you can do this, first and foremost has been shared with you through the use of GPS hardware. That will detect the location, and you can then write the program to get the location and show it or process it. However, if you need to get the location of a machine inside the office or a building, you can also possibly use the network interfaces, to determine where the machine is at the moment. Note that, this is very bad in cases where you need to pinpoint location, but changes can be detected easily based on the network or the endpoint from where the machine is communication. And as for Visual Basic, which one? The VB 6? I am unsure, whether you will be able find any solution for that, C++ or C# or Java might do some help in these cases. Even Vb.NET would require some help from C# world. Have a look here, [monitoring - Is it possible to find a computer's physical location in a room? - Server Fault](https://serverfault.com/questions/671781/is-it-possible-to-find-a-computers-physical-location-in-a-room)
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~
Thanks for your vital information!