Ver Mensaje Individual
  #9 (permalink)  
Antiguo 28/06/2011, 12:04
rus7
 
Fecha de Ingreso: enero-2004
Mensajes: 16
Antigüedad: 20 años, 3 meses
Puntos: 0
Respuesta: Utilizar jar en javascript

Parece que ya esta solucionado y me empiezan a funcionar alfunas funciones.

Hay una que no me funciona es la siguiente

public String login(String name, char[] password) {
this.sendCommand("/login");
String s = "a";
try {
s = this.getData();
} catch (InterruptedException ex) {
Logger.getLogger(ApiConn.class.getName()).log(Leve l.SEVERE, null, ex);
return "failed read #1";
}
if (!s.contains("!trap") && s.length() > 4) {
String[] tmp = s.trim().split("\n");
if (tmp.length > 1) {
tmp = tmp[1].split("=ret=");
s = "";
String transition = tmp[tmp.length - 1];
String chal = "";
chal = Hasher.hexStrToStr("00") + new String(password) + Hasher.hexStrToStr(transition);
chal = Hasher.hashMD5(chal);
String m = "/login\n=name=" + name + "\n=response=00" + chal;
s = this.sendCommand(m);
try {
s = this.getData();
} catch (InterruptedException ex) {
Logger.getLogger(ApiConn.class.getName()).log(Leve l.SEVERE, null, ex);
return "failed read #2";
}
if (s.contains("!done")) {
if (!s.contains("!trap")) {
return "Login successful";
}
}
}
}
return "Login failed";
}

Cuando compilo el applet me da el siguiente error

login(java.lang.String,char[]) in libAPI.ApiConn cannot be applied to (java.lang.String,char)

para llamarla utilizo el comando:

ret.login ("192.168.1.1", "admin")

Como paso los valores a un CHAR[]??