1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| String cmd = "cmd.exe /c tethereal -i 2";
try{
Process conf = Runtime.getRuntime().exec(cmd);
BufferedReader ds = new BufferedReader( new InputStreamReader (conf.getInputStream()));
String lineCourante = ds.readLine();
fen.getTextArea().setText("Start sniffing...\n\n");
while (lineCourante != null) {
text += lineCourante;
System.out.println(lineCourante);
fen.getTextArea().append(lineCourante+"\n");
lineCourante = ds.readLine();
if(stop)
break;
}
System.out.println("C'est la fin..........");
}catch(IOException ioe){
JOptionPane.showMessageDialog(this.fen, ioe.getMessage(),"Erreur:",JOptionPane.ERROR_MESSAGE);
}
return; |
Partager