1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
public envoi(String envoi,String Racine,String Dencours){
try{
Senvoi=envoi;
Dencours_bis = Dencours;
//connexion au serveur
telnet.connect("canopus",23);
// recuperation des infos
in = telnet.getInputStream();
out= new PrintStream(telnet.getOutputStream(),false);
fss = new PrintStream(telnet.getOutputStream());
br = new BufferedReader(new InputStreamReader(telnet.getInputStream()),6000000);
String s = File.separator;
File Fencours=new File(Dencours);
FileWriter fw = new FileWriter(Fencours,false);
String strecrase = "";
fw.write(strecrase);
fw.close();
readUntil("login: ");
write("er65467");
readUntil(": ");
write("rototo2012");
readUntil("$" + "");
write("cd "+ Racine);
System.out.println("=="+Senvoi+"==");
readUntil3("$" + "");
//write(Senvoi);
write("nastran mem=150m Old=No par=1 buff=32768 scr=Yes smem=150m rivets_rbe_light_v3.dat"); //--> probleme ici
readUntil3("<EOT>");
inscription();
telnet.disconnect();
}catch(Exception ev){
ev.printStackTrace();
JOptionPane.showConfirmDialog(null, " attention probleme", " Attention surcharge", JOptionPane.WARNING_MESSAGE);
}
}
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
public void write(String value){
try{
out.println(value);
out.flush();
//System.out.println(value);
}catch(Exception e){
e.printStackTrace();
}
} |