Permalink
Browse files

Added domain example

  • Loading branch information...
1 parent 2949e88 commit 06f3bcb53bb29e05748acfd9eab16fa01638dd00 @oschwald oschwald committed Oct 8, 2012
Showing with 23 additions and 2 deletions.
  1. +11 −2 README
  2. +12 −0 domainExample.cs
View
13 README
@@ -20,10 +20,16 @@ mono /usr/local/bin/mcs.exe countryV6Example.cs Country.cs DatabaseInfo.cs Locat
For cityV6 example
mono /usr/local/bin/mcs.exe cityV6Example.cs Country.cs DatabaseInfo.cs Location.cs LookupService.cs Region.cs RegionName.cs
-for region example
+For region example
mono /usr/local/bin/mcs.exe regionExample.cs Country.cs DatabaseInfo.cs Location.cs LookupService.cs Region.cs RegionName.cs
-to run the examples
+For org example
+mono /usr/local/bin/mcs.exe orgExample.cs Country.cs DatabaseInfo.cs Location.cs LookupService.cs Region.cs RegionName.cs
+
+For domain example
+mono /usr/local/bin/mcs.exe domainExample.cs Country.cs DatabaseInfo.cs Location.cs LookupService.cs Region.cs RegionName.cs
+
+To run the examples:
for country example
mono countryExample.exe
@@ -34,6 +40,9 @@ mono cityExample.exe 24.24.24.24
for org example
mono orgExample.exe
+for domain example
+mono domainExample.exe
+
for asn example
mono asnExample.exe
View
@@ -0,0 +1,12 @@
+//an example of how to lookup the isp or org of a ip address
+using System;
+using System.IO;
+class Appa0{
+ public static void Main(String[] args){
+ //open the database
+ LookupService ls = new LookupService("/usr/local/share/GeoIP/GeoIPDomain.dat", LookupService.GEOIP_STANDARD);
+ //get org of the ip address
+ String domain = ls.getOrg("24.24.24.24");
+ Console.Write(" domain: " + domain + "\n");
+ }
+}

0 comments on commit 06f3bcb

Please sign in to comment.