Comment on Tutorial - Simple Port Scanner application using Java By Syed M Hussain



Comment Added by : mobinga

Comment Added at : 2011-07-25 15:08:27

Comment on Tutorial : Simple Port Scanner application using Java By Syed M Hussain
Your code is syntactically correct, but semantically wrong.
You have to put the output statement within the catch blocks!

for(int i=startPortRange; i <=stopPortRange; i++)
{
try
{
Socket ServerSok = new Socket("127.0.0.1",i);
System.out.println("Port in use: " + i );
ServerSok.close();
}
catch (Exception e)
{ System.out.println( "Port" + i + "Not in Use");}

}


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. help, i want to migrate my system (asp to jsp)

View Tutorial          By: gendull at 2007-02-25 21:03:20

2. Hi,
I want to run a bat file, below are the

View Tutorial          By: Rajshekar at 2011-10-28 06:07:06

3. Perfectly working, and able to connect database.
View Tutorial          By: satyajit at 2012-06-01 20:16:53

4. Good introduction to J2ME..thanks for sharing this
View Tutorial          By: Som at 2010-11-13 00:03:53

5. Please guys i need sms.zip. I tried SMS.RAR but al
View Tutorial          By: Waseem at 2010-03-06 15:48:40

6. i am trying to create a handy and powerful barcode
View Tutorial          By: incoming barcode scanner at 2014-06-23 04:23:42

7. it's very good example to understands overloading
View Tutorial          By: Rakesh Sharma at 2011-11-18 06:37:49

8. very helpful to me.thanks.very very useful to me.
View Tutorial          By: viji at 2007-12-21 03:17:14

9. thank for this script
because i will work

View Tutorial          By: r at 2009-06-27 05:07:31

10. its realy gud which clears minor douts regarding t
View Tutorial          By: Shripad at 2010-01-19 05:40:41