![]() |
|
[.NET] Console application geo-location - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Console application geo-location (/showthread.php?tid=5488256) |
Console application geo-location - Xogg - Dec 8, 2016 Here is my Geo-Location in a console source! THIS CODE IS FOR A CONSOLE APPLICATION PHP Code * - Ninja - Dec 8, 2016 Why the ping? Won't the webclient throw an exception if there is no internet connection? And don't you think the end user will check it himself? And why not use a using statement on the webclient so it automatically disposes of it afterwards? And why not see if the user actually inputted a valid IP string, and not some random gibberish? * - Xogg - Dec 9, 2016 (Dec 8, 2016 05:49 PM)Ninja Wrote: Why the ping? Won't the webclient throw an exception if there is no internet connection? And don't you think the end user will check it himself? And why not use a using statement on the webclient so it automatically disposes of it afterwards? And why not see if the user actually inputted a valid IP string, and not some random gibberish? The ping was to make sure the user has a internet connection. And i would add some more stuff but this is just a small source I made in 5 mins for HackForums * - medocodersea - Dec 9, 2016 thanks so much mate i was need it lol ! * - Ninja - Dec 10, 2016 (Dec 9, 2016 08:29 PM)DexuhCodes Wrote: The ping was to make sure the user has a internet connection. And i would add some more stuff but this is just a small source I made in 5 mins for HackForums Yes but if the user has no internet connection the webclient will just throw an exception and you can handle that. * - Xogg - Dec 10, 2016 Oh true! did not think of that, Thanks! 🤝 |