我已经导入了 maxmind Dll 并下载了 GeoIp.dat 数据库以获取 IP 地址的国家名称我使用了以下代码
Dim ls As New LookupService("GeoIP.dat", LookupService.GEOIP_MEMORY_CACHE)
'get country of the ip address
Dim c As Country = ls.getCountry("24.24.24.24")
Console.Write(" code: " & c.getCode() & vbLf)
Console.Write(" name: " & c.getName() & vbLf)
CountryName.Text = " name: " & c.getName() & vbLf
但
Dim c As Country = ls.getCountry("24.24.24.24")
给我以下错误数据库已关闭。可能是什么问题呢