' Geolocation of IP Address - IP to Country ' Using Vbsedit's free Toolkit and Software77 database
Set ip = CreateObject("Vbsedit.iptocountry")
Set fso = CreateObject("Scripting.Filesystemobject")
If Not(fso.FileExists("iptocountry.bin")) Then If fso.FileExists("iptocountry.csv") Then ip.CreateDatabaseFromCsv "iptocountry.csv","iptocountry.bin" Else WScript.Quit End If Else If fso.FileExists("iptocountry.csv") Then If fso.GetFile("iptocountry.csv").DateLastModified > _ fso.GetFile("iptocountry.bin").DateLastModified Then ip.CreateDatabaseFromCsv "iptocountry.csv","iptocountry.bin" End If End If End If
'if you need to convert only a few IP addresses ip.DatabasePath = "iptocountry.bin"
'if you need to convert a lot of IP addresses 'ip.LoadDatabaseIntoMemory "iptocountry.bin"