Scanning ports
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, June 11, 2002 03:22 PM

What can I do to scan and find (if active) a determinate port scanning 255 IP number(from xxx.xxx.xxx.1 to xxx.xxx.xxx.255) ? I tried to do this operation with thread but it doesn't works correcly, below the part of code that I have used: public void doSomething() { String string = edit2.getText(); String string1 = edit3.getText(); String string2 = edit4.getText(); String sezioni = string + "." + string1 + "." + string2 + "."; for(int i = 1; i < 255; ++i ) { String host = sezioni+i; try { Socket s = new Socket(host, 1500); Thread.sleep(2500); InputStream is = s   More>>

What can I do to scan and find (if active) a determinate port scanning 255 IP number(from xxx.xxx.xxx.1 to xxx.xxx.xxx.255) ?
I tried to do this operation with thread but it doesn't works correcly, below the part of code that I have used:

public void doSomething()
{

String string = edit2.getText();
String string1 = edit3.getText();
String string2 = edit4.getText();
String sezioni = string + "." + string1 + "." + string2 + ".";


for(int i = 1; i < 255; ++i )
{



String host = sezioni+i;


try
{

Socket s = new Socket(host, 1500);
Thread.sleep(2500);
InputStream is = s.getInputStream();

BufferedReader br
= new BufferedReader(new InputStreamReader(is));

String line = br.readLine();


label12.setText(line);


br.close();

s.close();


}
catch (Exception ev)
{

}






progressBar1.setValue(i);


}
}




private void button11_click(Object source, Event e)
{

HTMLControl2.setURL("C:/Wdi/find02.htm");

Thread t;
t = Application.createThread(new MethodInvoker(this.doSomething));
try
{

t.start();

}
catch(IllegalThreadStateException itse)
{}

...........

Thanks

Pier Luigi

   <<Less
About | Sitemap | Contact