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



Comment Added by : Asad

Comment Added at : 2014-02-13 05:55:26

Comment on Tutorial : Simple Port Scanner application using Java By Syed M Hussain
Try this

import java.net.*;

public class PortScanner

{

public static void main(String args[])
{
int startPortRange=0;
int stopPortRange=0;

startPortRange = Integer.parseInt(args[0]);
stopPortRange = Integer.parseInt(args[1]);



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 not in use: " + i );
}
}
}


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. hie
can u plz tell how i maintain my rms f

View Tutorial          By: diya at 2010-04-30 01:38:06

2. Error loading SolarisSerial: java.lang.Unsatisfied
View Tutorial          By: Rahul at 2008-09-09 04:05:35

3. Comment: Just for future readers: (apart from the
View Tutorial          By: Anonymous at 2013-05-17 08:53:20

4. Thank you... :)
Simple and effective explan

View Tutorial          By: Mohammed Muzammil at 2012-08-08 05:07:32

5. give an recursive example using string
View Tutorial          By: sauk at 2011-08-22 16:16:41

6. hi,
please anyone tell me how to send bulk

View Tutorial          By: Nasrin at 2012-10-21 18:59:50

7. Hi Maybelline, This is the <a href="http:/
View Tutorial          By: Daniel Malcolm at 2008-08-21 06:57:31

8. main is not needed for a simple program...

View Tutorial          By: manoj at 2012-05-29 17:46:08

9. I get an error returned saying the SMPT server req
View Tutorial          By: Christian Peut at 2011-04-04 04:35:51

10. we are getting an error saying that " the sta
View Tutorial          By: chaitra at 2014-03-20 10:53:02