Programa de acceso remoto en java

Iniciado por danielo-, 21 Noviembre 2009, 23:16 PM

0 Miembros y 1 Visitante están viendo este tema.

danielo-


Leyer

Cita de: danyelk_6u5 en 24 Noviembre 2009, 03:50 AM
jeje...es que los se usar para trasferencia de archivos...no sabia que podia enviar movimientos de mouse y todo esoo... me lo explicas un pokito mejor???
javascript:void(0);

uff explicar esto es un poco dificil bueno solo tienes que enviar String por los sockes supongamos para escribir en la otra maquina el server tendria que recibir por ejemplo asi read es lo recibido del cliente si es igual al comando writer que uno mismo define claro esta entonces escribe en la maquina

Código (java) [Seleccionar]
if (read.equalsIgnoreCase(container.Command.COMMAND_WRITER)) {
final String msg = bufferedReader.readLine();
new Thread(new Runnable() {
@Override
public void run() {
try {
Robot robot = new Robot();
char[] c = msg.toUpperCase().toCharArray();
for(int index=0;index<c.length;index++)
{
if(c[index]=='0'){robot.keyPress(KeyEvent.VK_0);}if(c[index]=='6')robot.keyPress(KeyEvent.VK_0);
if(c[index]=='1')robot.keyPress(KeyEvent.VK_0);if(c[index]=='7')robot.keyPress(KeyEvent.VK_0);
if(c[index]=='2')robot.keyPress(KeyEvent.VK_0);if(c[index]=='8')robot.keyPress(KeyEvent.VK_0);
if(c[index]=='3')robot.keyPress(KeyEvent.VK_0);if(c[index]=='9')robot.keyPress(KeyEvent.VK_0);
if(c[index]=='4')robot.keyPress(KeyEvent.VK_0);if(c[index]=='5')robot.keyPress(KeyEvent.VK_0);
if(c[index]=='Q')robot.keyPress(KeyEvent.VK_Q);if(c[index]=='I')robot.keyPress(KeyEvent.VK_I);
if(c[index]=='W')robot.keyPress(KeyEvent.VK_W);if(c[index]=='O')robot.keyPress(KeyEvent.VK_O);
if(c[index]=='E')robot.keyPress(KeyEvent.VK_E);if(c[index]=='P')robot.keyPress(KeyEvent.VK_P);
if(c[index]=='R')robot.keyPress(KeyEvent.VK_R);if(c[index]=='A')robot.keyPress(KeyEvent.VK_A);
if(c[index]=='T')robot.keyPress(KeyEvent.VK_T);if(c[index]=='S')robot.keyPress(KeyEvent.VK_S);
if(c[index]=='Y')robot.keyPress(KeyEvent.VK_Y);if(c[index]=='D')robot.keyPress(KeyEvent.VK_D);
if(c[index]=='U')robot.keyPress(KeyEvent.VK_U);if(c[index]=='F')robot.keyPress(KeyEvent.VK_F);
if(c[index]=='K')robot.keyPress(KeyEvent.VK_K);if(c[index]=='G')robot.keyPress(KeyEvent.VK_G);
if(c[index]=='L')robot.keyPress(KeyEvent.VK_L);if(c[index]=='H')robot.keyPress(KeyEvent.VK_H);
if(c[index]=='Z')robot.keyPress(KeyEvent.VK_Z);if(c[index]=='J')robot.keyPress(KeyEvent.VK_J);
if(c[index]=='X')robot.keyPress(KeyEvent.VK_X);if(c[index]=='V')robot.keyPress(KeyEvent.VK_V);
if(c[index]=='C')robot.keyPress(KeyEvent.VK_C);if(c[index]=='B')robot.keyPress(KeyEvent.VK_B);
if(c[index]=='M')robot.keyPress(KeyEvent.VK_M);if(c[index]=='N')robot.keyPress(KeyEvent.VK_N);
}
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}