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. Can anyone help me.I need basic requirements with
View Tutorial          By: Elaiyaraja at 2009-03-09 03:47:46

2. at
OK
at+cmff=1
OK
at+

View Tutorial          By: shrinivas at 2009-03-07 23:16:51

3. I want to parse a xml content some think like bel
View Tutorial          By: sagar at 2011-04-20 00:59:06

4. please send me Java programs
View Tutorial          By: Jayita at 2009-11-06 08:19:59

5. i am newly in java. please send basic sample progr
View Tutorial          By: bhuvana at 2012-11-21 06:50:01

6. gud tutorial but the permission denied is because
View Tutorial          By: amithooda at 2012-06-11 06:43:00

7. Very useful n understandable. More understandable
View Tutorial          By: Kiran at 2015-08-27 06:13:00

8. NICE EXPLANATION >>>THANK UUUUUU
View Tutorial          By: PraVeen at 2012-07-05 10:12:25

9. How to display the ARP Mapping Table of a given ho
View Tutorial          By: Hala at 2013-11-15 22:42:36

10. I Want more Advanced Case Shown...
I Know E

View Tutorial          By: Electron at 2009-11-23 02:32:07