![]() |
|
[.NET] Get Flag From IP [UPDATED] - 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] Get Flag From IP [UPDATED] (/showthread.php?tid=4874028) |
Get Flag From IP [UPDATED] - Vysse - Jun 20, 2015 So I needed a working version of the get flag from IP so I updated the code from ubbelol's post years ago. Here is the code. Credits to ubbelol for the original code. Code Private Function retFlag(ByVal IP As String) As ImageFor those wondering why I used String.Remove instead of Regex the reason is Regex wasn't working properly for what I wanted to do and I couldn't figure out why so I went with a method I knew would work. * - The-One - Jun 21, 2015 Thanks for sharing with HF. Just a side note; your naming, 'retFlag' should be something more clear. Also, String.Split is MUCH faster then Regex.Split when using small strings and simple patterns :). * - Odus - Jun 21, 2015 Cleaned it up a little: Code Private Function FetchFlag(ip As String) As Image* - Only3 - Jun 21, 2015 (Jun 21, 2015 08:56 AM)Odus Wrote: Cleaned it up a little: 😊 Stream Dispose 😧 * - Vysse - Jun 21, 2015 (Jun 21, 2015 08:56 AM)Odus Wrote: Cleaned it up a little: Cleaned it. You rewrote it. Nice job I had no idea about ip-api.com. * - VmX5 - Jun 23, 2015 Replace INSERT LINK 1 HERE with : htt3p://ip-api.co3m/csv/ Remove the 3's from the link above! Replace INSERT LINK HERE 2 with : http3s://geoiptool.co3m/static/img/flags/ Remove the 3's from the link above! *SORRY I CANNOT POST LINKS YET! *Function : Code Public Function GetFlag(ByVal ip As String)*Calling Function Code PictureBox1.ImageLocation = GetFlag("216.58.218.174") 'Google.com IP |