%@page import="com.maxmind.geoip.*" %> <%@page import="java.io.*" %> <% String strCountry = ""; try { String sep = System.getProperty("file.separator"); String dir = "/home/idres2/public_html/WEB-INF/classes"; String dbfile = dir + sep + "GeoIP.dat"; LookupService cl = new LookupService(dbfile,LookupService.GEOIP_MEMORY_CACHE); String strIP = request.getRemoteAddr(); strCountry = cl.getCountry(strIP).getCode(); cl.close(); } catch (IOException e) { } %>
|
|
|||