Import java.net. *; import java.io. *;
Public Class Scanner Implements Runnable {Private inetaddress ipaddress; private thread allportthread;
Public Scanner (String ipaddress, int port) {TRY {this.ipaddress = this.ipaddress.getByname (ipaddress); this.port = port;} catch (exception e) {system.out.println ("The host does not exist) "}}
Public void run () {
Try {socket test = new socket (this.ipaddress, this.port); // if this port cannot been connection, throw a exception. system.out.println (this.port ": exist"); // if connected , Print out.} catch (exception e) {}}
Public static void main (string ") {string str; str =" TPOI Scanner 1.0 - Network host scanner / n "; str =" Author: TT (TPOI: http://www.tpoi.net) / n / N "; STR =" Usage: scanner