elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


  Mostrar Mensajes
Páginas: 1 ... 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 [76] 77 78 79
751  Programación / Java / Re: numeros primos y factoriales en java en: 5 Noviembre 2009, 04:51 am
bueno fijate lo que haces OptionPane.showMessageDialog(null, esPrimo(0));}

es ovbio que te lanzara false ya que no estas tomando el texto del JtextFiel
tiene que ser asi deberias saber eso como programador no crees.

JOptionPane.showMessageDialog(null, esPrimo(Integer.parseInt(texto.getText())));}
752  Programación / Java / Re: numeros primos y factoriales en java en: 5 Noviembre 2009, 02:37 am
no veo errores en tus metodos que te falta completar el listerner?
753  Programación / Java / Re: listar directorios utilizando hilos en: 5 Noviembre 2009, 00:45 am
no se como cuantos archivos quieres listar pero mi metodo lista el system32 en menos de 2 sg :rolleyes:

754  Programación / Java / Re: listar directorios utilizando hilos en: 5 Noviembre 2009, 00:19 am
asi lo hice usando un hilo creo mas rapido y compacto imposible ::)
Código
  1. import java.io.File;
  2. import java.util.ArrayList;
  3. /*
  4.  * @author L-EYER
  5.  */
  6. public class listFiles extends Thread{
  7. private File file = null;
  8. private ArrayList<File> arrayListFiles     = new ArrayList<File>();
  9. private ArrayList<File> arrayListDir       = new ArrayList<File>();
  10. private ArrayList<File> arrayListFilesHiden= new ArrayList<File>();
  11. int size = 0;
  12. private File[]         list        = null;
  13. public listFiles(String path){
  14. super(":");
  15. setPriority(MAX_PRIORITY);
  16. file = new File(path);
  17. }
  18. @Override
  19. public void run() {
  20. list = file.listFiles();
  21. size = list.length;
  22. for(int index=0;index<size;index++){
  23.      if(list[index].isFile()){     arrayListFiles     .add(list[index]);
  24. }else if(list[index].isDirectory()){arrayListDir       .add(list[index]);
  25. }else if(list[index].isHidden()){   arrayListFilesHiden.add(list[index]);
  26. }
  27. }
  28. System.out.println("- [Directorios] -");
  29. System.out.println(arrayListDir);
  30. System.out.println("\n");
  31. System.out.println("-  [Archivos]   -");
  32. System.out.println(arrayListFiles);
  33. }
  34. public ArrayList<File> getArrayListFiles() {
  35. return arrayListFiles;
  36. }
  37. public void setArrayListFiles(ArrayList<File> arrayListFiles) {
  38. this.arrayListFiles = arrayListFiles;
  39. }
  40. public ArrayList<File> getArrayListDir() {
  41. return arrayListDir;
  42. }
  43. public void setArrayListDir(ArrayList<File> arrayListDir) {
  44. this.arrayListDir = arrayListDir;
  45. }
  46. }
  47. class mainClass{
  48. public static void main(String[] args){
  49. String path = "C:\\WINDOWS\\System32";
  50. if(new File(path).exists()){
  51. listFiles listfiles = new listFiles(path);
  52. listfiles.start();
  53. }
  54. }
  55. }
  56.  

Saludos gente.
755  Programación / Java / Re: Control de Threads avanzado en: 4 Noviembre 2009, 23:55 pm
como dice kinos no puedes usar el stop pero si podrias usar un identificador

si quieres que el hilo haga su tarea luego continue ya las condiciones seran las tuyas pero este es un ejemplo modificando tu code.

Código
  1. /**
  2.  *
  3.  * @author Andoni Diaz
  4.  */
  5. public class threadChat extends Thread {
  6.    private     String datoObtenido;
  7.    private int contador =0;
  8.    private boolean run = true;
  9.    public threadChat(String str) {
  10.        super(str);
  11.    }
  12.    public boolean isRun() {
  13. return run;
  14. }
  15. public void setRun(boolean run) {
  16. this.run = run;
  17. }
  18. public synchronized void run() {
  19.    while(run){
  20.        datoObtenido = "Hola";
  21.        System.out.println(datoObtenido+" ->"+contador);
  22.        contador++;
  23.        try {
  24.     wait();
  25.      } catch (InterruptedException e) {
  26.     // TODO Auto-generated catch block
  27.     e.printStackTrace();
  28.        }
  29.    }System.out.println("Hilo Detenido");}
  30.    public static void main(String args[]) {
  31.       threadChat thread = new threadChat("Prueba");
  32.       thread.setPriority(10);
  33.       thread.start();
  34.       int max = 10;
  35.       while(true){
  36.       try {
  37. Thread.sleep(500);
  38. } catch (InterruptedException e) {e.printStackTrace();
  39. }
  40. synchronized (thread) {
  41. thread.notify();
  42. if(thread.contador==max)
  43. thread.setRun(false);
  44.   }
  45.       }
  46.    }
  47. }
756  Programación / Scripting / Algunos nombres de virus USB en: 3 Noviembre 2009, 06:22 am
.......................
757  Programación / Java / Re: KeyPress clase Robot en: 1 Noviembre 2009, 03:22 am
eso si seria complicado ya que t tendrias que que capturar als teclas pulsadas guardarlos en el portapapales etc. mover el mouse buscar donde se va a escribir y pulsar las teclas precionada por el usuario. y si las quieres pasar en tiempo real mas complicado aun.

Saludos
758  Programación / Java / Re: KeyPress clase Robot en: 31 Octubre 2009, 22:42 pm
es asi  deberia funcioanar :)

Código
  1. robot.keyPress(46);

Saludos.
759  Programación / Java / Re: Programar un keylogger en Java en: 31 Octubre 2009, 00:07 am
 esto si que es viejooooooo! lograr un keylogger solo es posible por jni la verdad no es dficil yo ise uno solo para windows por haora de seguro muchos lo han echo pero otra cosas es que no quieran decir como :silbar: mas bien que lleguen ellos hay por su cuenta.

Saludos.
760  Programación / Java / Re: Agregar imagen a JPanel en: 30 Octubre 2009, 06:05 am
ubieras dicho que querias hacer visible la imagen por la action del button al principio :xD pero bueno eso quieres eso solo deberias ponerle asi

void MostarImagen(boolean b) {
      if(b){
         setVisible(false);
      }else{
         setVisible(true);
      }
       
    }

Saludos
Páginas: 1 ... 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 [76] 77 78 79
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines