desculpem esqueci de anexar o
arquivo....
|
Aplicacao PortScanner: import java.net.*; import java.io.*;
public class PortScanner { public static void main(String[] args) { String host = "x.x.x.x"; if (args.length > 0) { host = args[0]; } try { InetAddress the Address = InetAddress.getByName(host); for (int i =1; i < 65536; i++) { Socket connection = null; try { connection = new Socket(host, i); System.out.println ("Existe um servico habilitado na porta " + i + "of" + host); } catch (IOException e) { // nao ha um servidor nesta porta } finally { try { if (connection ! = null) connection.close(); } catch (IOException e) {} } }// end for }// end try catch (UnknownHostException e) { System.err.println(e); } }//end main }//end PortScanner
------------------------------ LISTA SOUJAVA ---------------------------- http://www.soujava.org.br - Sociedade de Usuários Java da Sucesu-SP dúvidas mais comuns: http://www.soujava.org.br/faq.htm regras da lista: http://www.soujava.org.br/regras.htm para sair da lista: envie email para [EMAIL PROTECTED] -------------------------------------------------------------------------