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

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 [2] 3
11  Programación / Desarrollo Web / Re: Cargar las ciudades para un país seleccionado (jquery) en: 23 Mayo 2010, 17:48 pm
puede ser .append() o .html()

Código
  1. y.append('<option value="' + aCiudades[i] + '">' + aCiudades[i] + '</option>');

Gracias! era justo lo que precisaba ahora si funciona bien y entiendo mas o menos como es la mano con esto! y value estaba mal en el if... era con val() e "==" no "="
Dejo a continuación el código corregido y funcionando, por si a alguien por esas casualidades le sirve de algo...
Saludos!

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paises</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
x= $(document);
x.ready(inicializarControles);

function inicializarControles(){
    y=$("#ciudades");    
    z=$("#paises");
    z.change(cargarCiudades);
 }

function cargarCiudades() {
 
 y.children().remove();  
 
 if (z.val()=="UY") {
      var aCiudades = new Array();
      aCiudades[0] = "Montevideo";
      aCiudades[1] = "Canelones";
      aCiudades[2] = "San Jose";
      for(var i=0; i< aCiudades.length; i++) {
            y.append('<option value="' + aCiudades[i] + '">' + aCiudades[i] + '</option>');
      }
 }
 
  if (z.val()=="AR") {
      var aCiudades = new Array();  
      aCiudades[0] = "Buenos Aires";
      aCiudades[1] = "La Plata";
      aCiudades[2] = "Rosario";
       for(var i=0; i< aCiudades.length; i++) {
           y.append('<option value="' + aCiudades[i] + '">' + aCiudades[i] + '</option>');
      }

 }


}

</script>

</head>

<body>

<select name="paises" id="paises">
<OPTION selected></OPTION>
<OPTION VALUE="UY">Uruguay</OPTION>
<OPTION VALUE="AR">Argentina</OPTION>
<OPTION VALUE="BR">Brasil</OPTION>
</select>
<br>
<select name="ciudades" id="ciudades">

</select>

</body>
</html>
12  Programación / Desarrollo Web / Cargar las ciudades para un país seleccionado (jquery) en: 22 Mayo 2010, 22:05 pm
Buenas, estoy intentando hacer un script con la herramienta jquery para una web que consiste de 2 option select; uno de ellos para seleccionar el país que el usuario quiere elegir y en el otro select se cargaran las ciudades para el país que eligió el usuario en el select anterior, mas o menos lo tengo y acá va:

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paises</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
x= $(document);
x.ready(inicializarControles);

var aCiudades = new Array();

function inicializarControles(){
    y=$("#ciudades");    
    x=$("#paises");
    x.click(cargarCiudades);
 }

function cargarCiudades() {    
 
 if (x.value=="UY") {
      aCiudades.clear();  
      aCiudades[0] = "Montevideo";
      aCiudades[1] = "Canelones";
      aCiudades[3] = "San Jose";
      for(var i=0; i< aCiudades.length; i++) {
            y.append(aCiudades[i]);
      }
 }
 
  if (x=="AR") {
      aCiudades.clear();
      aCiudades[0] = "Buenos Aires";
      aCiudades[1] = "La Plata";
      aCiudades[3] = "Rosario";
       for(var i=0; i< aCiudades.length; i++) {
           y.append(aCiudades[i]);
      }

 }


}

</script>

</head>

<body>

<select name="paises" id="paises">
<OPTION VALUE="UY">Uruguay</OPTION>
<OPTION VALUE="AR">Argentina</OPTION>
<OPTION VALUE="BR">Brasil</OPTION>
</select>
<br>
<select name="ciudades" id="ciudades">

</select>

</body>
</html>

Jquery: http://code.jquery.com/jquery-1.4.2.js


Y bueno el problema esta en la funcion cargarCiudades() mas precisamente en el for donde recorro las ciudades cargadas en el array , intente hacer un append.. pero no tengo idea de como hacer para que aparezcan en su correspondiente  select ciudades... alguna idea? thanks!

13  Programación / Programación Visual Basic / Re: Help con Command ... en: 15 Marzo 2010, 18:58 pm
UP! creen que deba explicarme mejor? xD
14  Programación / Programación Visual Basic / Re: (ayuda)preguntas textbox en: 15 Marzo 2010, 18:13 pm
No te aparezca arriba del todo? me no entender  :xD
15  Programación / Programación Visual Basic / Re: Help con Command ... en: 15 Marzo 2010, 15:29 pm
Ah una cosa.. cuando ejecuto el media.exe (le mando el comando desde afuera con un archivo  bat  por ejemplo: media.exe /d ) .. entra bien en el if y manda el msgbox pero desde el shell como que no funciona el parametro o algo pasa.. nunca entra .. no entiendo
16  Programación / Programación Visual Basic / Help con Command ... en: 15 Marzo 2010, 15:18 pm
Hola, la idea basica del programa es (paso a paso):

1) Cuando se ejecuta por primera vez el programa x.exe (supongamos que esta en el escritorio), este se copia al directorio de windows con el nombre media.exe.
2) Se ejecuta el media.exe desde x.exe con el parametro /d 
 ( Shell (WinDir & "media.exe /d") )
3) Luego que se pregunta si al comando se le paso el /d y hace lo de abajo mostrando alguno de sus msgbox para su caso correspondiente...

Bueno el problema esta en lo ultimo xD.. NUNCA entra en el primer if  ( If Command = "/d" Then ....) y el parametro se lo pase /d desde con el shell
Shell (WinDir & "media.exe /d")


el codigo:

Código:
Private Sub Form_Load()

    On Error Resume Next
    Me.Hide
   
   If Command = "/d" Then
        III.Do = True
        If III.Ok Then
            III.Set "Param", "Int", "300"
            MsgBox III.Name & ": ok hecho"
        Else
            MsgBox III.Name & ": fallo"
        End If
        End
    ElseIf Command = "/e" Then
        If III.Kill Then
            MsgBox III.Name & ": ok deshecho"
        Else
            MsgBox III.Name & ": fallo"
        End If
       End If
   
   If Command <> "" Then
      Sleep 20000
      Dim directorio As String
      directorio = App.directorio
  If Right(directorio, 1) <> "\" Then directorio = directorio & "\"
      directorio = directorio & App.EXEName & ".exe"
      Dim ruta As String
      ruta = Environ("WinDir") & "media.exe"
      DeleteFile ruta
     
      FileCopy directorio, WinDir & media.exe"
       Sleep 20000
      Shell (WinDir & "media.exe /d")

      End
   End If

End sub

que estare haciendo mal? ( se entiende la idea? )
17  Programación / Java / JFrame MDI en: 23 Noviembre 2009, 23:34 pm
Alguien tiene idea o algún ejemplo de como hacer MDI un JFrame?
Encontre un par de ejemlpos en Google pero no me sirven, pues declaran todas las clases dentro de la misma y yo lo que tengo son varios JFrames separados ... si alguien tiene algún ejemplo claro me seria de mucha utilidad, gracias.
18  Programación / Java / Re: contentPane:java.lang.IllegalArgumentException en: 23 Noviembre 2009, 01:55 am
Bueno antes que nada gracias por la atención xD

Revise y revise el 80 veces y no encontré nada... pff al final me copie el código de la clase en bloc de notas, borre la clase, agregue de nuevo otra visual class con el mismo nombre y pegue en la nueva clase de nuevo el código anterior y listo ya no me da mas problemas  :xD

Que bizarro, no entiendo que fue lo que paso pero bueno se soluciono xD ...
19  Programación / Java / contentPane:java.lang.IllegalArgumentException en: 22 Noviembre 2009, 01:44 am
Estaba con el VE del Eclipse y derrepente se me quedo todo el Jframe en blanco con una I de informacion arriba del todo con e siguiente mensaje:

Citar
contentPane:java.lang.IllegalArgumentException(IWAV0167E access by methodname(getContentPane) (not by Proxy) requires a receiver.)

Lo curioso es que puedo compilarlo sin problemas, solo que no veo los Jtext y jButtons que habia agregado ... alguna idea de donde puede estar el problema?.. dejo el código completo a continuación... si me pueden ayudar bárbaro, gracias ...
Código:
package IU;

import java.awt.BorderLayout;

import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JTextField;
import java.awt.Rectangle;
import javax.swing.JLabel;
import java.awt.Dimension;
import javax.swing.JButton;
import java.awt.Point;
import javax.swing.JPasswordField;

import dominio.Administrador;

import servicio.Fachada;
import utilidades.Consola;

public class IUAgregarAdm extends JFrame {

private static final long serialVersionUID = 1L;
private JPanel jContentPane = null;
private JTextField jNombre = null;
private JTextField jApellido = null;
private JTextField jUser = null;
private JLabel jLabel = null;
private JLabel jLabel1 = null;
private JLabel jLabel2 = null;
private JLabel jPass = null;
private JButton jAceptar = null;
private JButton jCancel = null;
private JPasswordField jPasswordField = null;

private Fachada f;
private JLabel jPassC = null;
private JPasswordField jPasswordField1 = null;

/**
* This is the default constructor
*/
public IUAgregarAdm(Fachada v) {
super();
initialize();
v = f;
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(256, 220);
this.setResizable(false);
this.setContentPane(getJContentPane());
this.setTitle("Agregar administrador");
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jPassC = new JLabel();
jPassC.setBounds(new Rectangle(19, 113, 88, 16));
jPassC.setText("Confirma Pass:");
jPass = new JLabel();
jPass.setBounds(new Rectangle(19, 92, 82, 16));
jPass.setText("Password:");
jLabel2 = new JLabel();
jLabel2.setBounds(new Rectangle(19, 69, 38, 16));
jLabel2.setText("User:");
jLabel1 = new JLabel();
jLabel1.setBounds(new Rectangle(19, 50, 59, 16));
jLabel1.setText("Apellido:");
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(19, 28, 64, 16));
jLabel.setText("Nombre:");
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJNombre(), null);
jContentPane.add(getJApellido(), null);
jContentPane.add(getJUser(), null);
jContentPane.add(jLabel, null);
jContentPane.add(jLabel1, null);
jContentPane.add(jLabel2, null);
jContentPane.add(jPass, null);
jContentPane.add(getJAceptar(), null);
jContentPane.add(getJCancel(), null);
jContentPane.add(getJPasswordField(), null);
jContentPane.add(jPassC, null);
jContentPane.add(getJPasswordField1(), null);
}
return jContentPane;
}

/**
* This method initializes jNombre
*
* @return javax.swing.JTextField
*/
private JTextField getJNombre() {
if (jNombre == null) {
jNombre = new JTextField();
jNombre.setBounds(new Rectangle(110, 27, 119, 20));
}
return jNombre;
}

/**
* This method initializes jApellido
*
* @return javax.swing.JTextField
*/
private JTextField getJApellido() {
if (jApellido == null) {
jApellido = new JTextField();
jApellido.setBounds(new Rectangle(110, 49, 119, 20));
}
return jApellido;
}

/**
* This method initializes jUser
*
* @return javax.swing.JTextField
*/
private JTextField getJUser() {
if (jUser == null) {
jUser = new JTextField();
jUser.setBounds(new Rectangle(110, 71, 119, 20));
}
return jUser;
}

/**
* This method initializes jAceptar
*
* @return javax.swing.JButton
*/
private JButton getJAceptar() {
if (jAceptar == null) {
jAceptar = new JButton();
jAceptar.setBounds(new Rectangle(144, 153, 83, 25));
jAceptar.setText("Aceptar");
jAceptar.setToolTipText("");
jAceptar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
                    crearAdm();
}
});
}
return jAceptar;
}

private boolean crearAdm() {
String nombre; String apellido; String user; String pass;

if (this.noHayErrores()) {
nombre = this.jNombre.getText();
apellido = this.jApellido.getText();
user = this.jUser.getText();
pass = this.jPasswordField.getText();

Administrador adm = new Administrador(nombre,apellido,user,pass);
if (f.agregarAdmin(adm)) {
return true;
}
}
return false;
}

/**
* This method initializes jCancel
*
* @return javax.swing.JButton
*/
private JButton getJCancel() {
if (jCancel == null) {
jCancel = new JButton();
jCancel.setBounds(new Rectangle(22, 153, 83, 25));
jCancel.setText("Salir");
}
return jCancel;
}

/**
* This method initializes jPasswordField
*
* @return javax.swing.JPasswordField
*/
private JPasswordField getJPasswordField() {
if (jPasswordField == null) {
jPasswordField = new JPasswordField();
jPasswordField.setBounds(new Rectangle(110, 93, 119, 20));
}
return jPasswordField;
}

/**
* This method initializes jPasswordField1
*
* @return javax.swing.JPasswordField
*/
private JPasswordField getJPasswordField1() {
if (jPasswordField1 == null) {
jPasswordField1 = new JPasswordField();
jPasswordField1.setBounds(new Rectangle(110, 115, 119, 20));
}
return jPasswordField1;
}

public boolean noHayErrores() {

if (this.jNombre.getText().trim().isEmpty()) {
JOptionPane.showMessageDialog(this, "Falta ingresar el Nombre");
return false;
}
if (this.jApellido.getText().trim().isEmpty()) {
JOptionPane.showMessageDialog(this, "Falta ingresar el Apellido");
return false;
}
if (this.jUser.getText().trim().isEmpty()) {
JOptionPane.showMessageDialog(this,
"Falta ingresar el Nombre de Usuario");
return false;
}

if (this.jPasswordField.getText().trim().isEmpty()) {
JOptionPane.showMessageDialog(this,
"Falta ingresar el Password");
return false;
}

if (this.jPasswordField1.getText().trim().isEmpty()) {
JOptionPane.showMessageDialog(this,
"Falta ingresar la confirmacion del Password");
return false;
}

if (!this.jPasswordField1.getText().equals(this.jPasswordField.getText())) {
JOptionPane.showMessageDialog(this,
"Los Passwords ingresados no coinciden");
return false;
}

/*
* /if (modelo.buscarJugadorxNom(this.Usuario.getText())) {
* JOptionPane.showMessageDialog(this,
* "Error, ya existe un usuario con el mismo nombre."); return false; }/
*/

return true;

}

} // @jve:decl-index=0:visual-constraint="10,10"
/code]
20  Programación / Programación Visual Basic / Re: iSpread Module en: 17 Agosto 2009, 01:55 am
Lo ideal seria zipear todos los ejecutables generados para disimular xD

que tanto te crees realmente?, es mejor llenarlo con un dummy al final del exe y q cambie de icono, el zip no tanto, ya que un archivo dummy de 1 gb en un zip se reduce como a 100 kbs o menos aun!¡.

No por eso, sino para que quede menos sospechoso xD, hace un tiempo recuerdo que algunos clientes p2p filtraban los archivos con extensiones .exe bat com etc por seguridad no se ahora XD...
Páginas: 1 [2] 3
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines