Java Reference
In-Depth Information
/**
* Typical Java main method, create an object, and then
* start the object passing arguments. If insufficient
* arguments are provided, then display startup
* instructions.
*
* @param args Program arguments.
*/
public static void main(String args[])
{
try
{
if (args.length != 1)
{
System.out.println(
"Usage: ScanSites [IP prefix, i.e. 192.168.1]");
} else
{
ScanSites d = new ScanSites();
d.scan(args[0]);
}
} catch (Exception e)
{
e.printStackTrace();
}
}
}
To run this program, you must specify the IP prefix. For example, to scan the IP prefix
192.168.1 you would use the following command:
ScanSites http://www.httprecipes.com/
The above command simply shows the abstract format to call this recipe, with the ap-
propriate parameters. For exact information on how to run this recipe refer to Appendix B,
C, or D, depending on the operating system you are using. You may find more sites on your
home network than you knew existed. For example, I found that my laser printer has a web
site. Logging into my printer's built in web site shows me how much toner is still available.
You can see the results of my scan in Figure 4.1.
Search WWH ::




Custom Search