Download IP to Country Free Database from Software77.net


' 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")

IfNot(fso.FileExists("iptocountry.bin")) Then
  If fso.FileExists("iptocountry.csv") Then
    ip.CreateDatabaseFromCsv"iptocountry.csv","iptocountry.bin"
  Else
    WScript.Quit
  EndIf
Else
  If fso.FileExists("iptocountry.csv") Then
    If fso.GetFile("iptocountry.csv").DateLastModified > _
          fso.GetFile("iptocountry.bin").DateLastModifiedThen
      ip.CreateDatabaseFromCsv"iptocountry.csv","iptocountry.bin"
    EndIf
  EndIf
EndIf

'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"

code = ip.IpToCountry("185.238.208.18")
WScript.Echo code

WScript.Echo ip.CountryCodeToLongCode(code)
WScript.Echo ip.CountryCodeToCountryName(code)
search for scripts

VbsEdit contains all these sample scripts!


Download Now!



Download   Home   Scripts

Copyright © 2001-2024 adersοft