inama1
Messages postés10Date d'inscriptionlundi 26 mars 2012StatutMembreDernière intervention18 mai 2012
-
18 mai 2012 à 09:18
cs_laurent1024
Messages postés987Date d'inscriptionmardi 31 mai 2005StatutMembreDernière intervention30 août 2012
-
18 mai 2012 à 14:34
Bonjour,
j'ai réussi à connecter à un switch , mais il y a un problème dans l'exécution de ma classe qui limite le bon fonctionnement de mon projet( dans la coté gauche et au dessus de netbeans le Running reste bloqué ).
J’espère que vous avez compris ma demande.
Voici mon code , aidez moi à trouver l'erreur et merci pour votre collaboration :)
package bean;
/**
* Class represents the router i/f
* in other words : handles router interaction
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
public ping( String server, String user, String password ) {
try {
// Connect to the specified server
telnet.connect( server, 23 );
// Get input and output stream references
in = telnet.getInputStream();
//BufferedWriter fop = new BufferedWriter(new FileWriter("c:\\test.txt"));
//OutputStream output = new FileOutputStream("c:\\ping.txt");
//PrintWriter in = new PrintWriter( new FileWriter("c:\\ping.txt") );
//output.close();
out = new PrintStream( telnet.getOutputStream() );
// Log the user on
readUntil( "Username: " );
write( user );
PrintStream out = new PrintStream(new FileOutputStream("c:\\services\\GTB.txt"));
System.setOut(out);
//PrintStream out = new PrintStream(new FileOutputStream("c:\\Documents and Settings\\asma.tounsi.stg\\listcommand.txt"));
//System.setOut(out);
}
catch( Exception e ) {
}
}
cs_laurent1024
Messages postés987Date d'inscriptionmardi 31 mai 2005StatutMembreDernière intervention30 août 201225 18 mai 2012 à 14:34
Bonjour.
Tu aurais pu utiliser la balise code, et mettre de l'indentation dans ton code, parce que là c'est pas évident à lire.
Dans tes catch, ajoute des printStackTrace(), ça permettra de voir s'il y a des exceptions