import java.net.*;
import java.io.*;
public class PortScan1
{
private String IPAddress;
private int Port;
public void run()
{
try
{
Socket TestPort = new Socket(“192.168.8.100″, 80); //if this port cannot been connected, throw a exception.
System.out.println(“ok”); //if connected, print ok.
}
catch(Exception e)
{
//this.result=”failed”; //if not connected, print failed.
}
}
public static void main(String[] args)
{
PortScan1 PortScan1 = new PortScan1();
PortScan1.run();
}
}