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

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Temas
Páginas: [1] 2 3
1  Programación / PHP / MySQL Handler (Clase en php) para los que utilizan MySQL ;) en: 12 Noviembre 2007, 23:14 pm
Hola!

Quiero compartir una cosilla....

Se trata de una clase programada en php para generar consultas de manera rápida y sencilla mediante objetos. Ésta es la primera versión, pero la iré mejorando poco a poco (dentro de lo que se pueda). La clase esta documentada, por lo que veréis que podéis ver como esta construida de manera ordenada.
Esta clase, la hice con el motivo de no estar todo el rato repitiendo sentencias que ocupan muchas líneas y, como es lógico, espacio y tamaño.

Bueno, sin más, os dejo aqui el paquete de la clase con el que incluyo un archivo que explica como se usa la clase de manera práctica:
- http://mysqlhandler.stage7.es/mysql.handler.rar

Podéis también ver la clase documentada on-line aquí:
- http://mysqlhandler.stage7.es


Aquí os pongo el archivo test.php, para que antes de descargaroslo, veáis como funciona:
Código:
<?php

/**
 * @author The Sixth Halcon
 * @copyright 2007
 * ==============================================================
 * Test file for MySQLHandler Class
 * ==============================================================
 */

require("mysql.handler.php");

// Crea un nuevo objeto
$sql = new MySQLHandler("localhost", "root", "root");

// Crea la base de datos 'handler'
$sql->CreateDB("handler");

// Selecciona la base de datos 'handler'
$sql->SelectDB("handler");

// Selecciona la tabla 'prueba'
$sql->SelecTable("prueba");

// Elimina la tabla 'prueba'
$sql->DeleteTable();

// Desselecciona la tabla 'prueba' [Now there is no table selected]
$sql->NoTable();

// Create a table called 'prueba'
$sql->CreateTable("prueba", "`id` varchar(10) NOT NULL, `a` varchar(10) NOT NULL, `b` varchar(10) NOT NULL");

// Selecciona la tabla 'prueba'
$sql->SelecTable("prueba");

// Inserta una nueva fila en la tabla 'prueba'
$sql->Insert(",", "id,a,b", "1,abc,def");

// Cambia los valores de una fila en la tabla 'prueba'
$sql->Update("WHERE id=1", ",", "a,b", "contenido,que quiero");

// Devuelve la sentencia SELECT en la tabla 'prueba'
$pepe = $sql->Select("*", "WHERE id=1");

// Hace un query libre, el query que tu quieras
$sql->Query(0, "UPDATE prueba SET a='contenido', b='Que quiero' WHERE id=1");

// Te devuelve un query libre
$pepa = $sql->Query(1, "UPDATE prueba SET a='contenido', b='Que quiero' WHERE id=1");

// Inserta una nueva fila en la tabla 'prueba'
$sql->Insert(",", "id,a,b", "2,abc,def");

// Elimina una fila en la tabla 'prueba'
$sql->Delete("WHERE id=2");

// Limpia todos las filas dejando sin filas a la tabla 'prueba'
$sql->CleanTable();

// Elimina la tabla 'prueba'
$sql->DeleteTable();

// Desselecciona la tabla 'prueba' [Now there is no table selected]
$sql->NoTable();

// Elimina la base de datos 'handler'
$sql->DeleteDB();

// Desselecciona la base de datos [This method/function is optionally, but is really useful if you are changing constantly from one database to other(s)]
$sql->NoDatabase();

?>
   

Un saludo a todo el mundo y disfrutadlo!

PD: Si veis algo que se puede mejorar o añadir, podéis decírmelo y yo lo modifico ;)
2  Programación / PHP / SQL & PHP: ¿Como hacer que los datos duren temporalmente? en: 19 Octubre 2007, 16:34 pm
Hola!

Quisiera saber como hacer que, por ejemplo, al meter una fila en una tabla de la SQL al mes se borrase, o al año, o cuando yo quiera, sin tener que abrir yo una pagina que compruebe cuando se introdujo y si ha pasado un mes o un año o lo que sea, se borre. ¿Se podria?

Gracias de antemano!
3  Programación / PHP / SQL & PHP: Busco el codigo de si una entrada existe, repetir un proceso en: 17 Octubre 2007, 22:49 pm
Hola!

Estoy trabajando con MySQL y PHP y me gustaria saber el codigo para verificar si un contenido de una variable esta en un campo de una fila o no, si esta, que se vuelva a repetir un proceso y si no esta, no.

Muchas gracias de antemano! ;)
4  Programación / PHP / ¿Como saco la DNS via PHP? en: 15 Septiembre 2007, 19:06 pm
Pues eso, no tiene mas... que como saco la DNS via php, a ver si alguien me ayuda jeje ;)

Muchas gracias de antemano ;)
5  Programación / Java / Errores raros :S en: 1 Junio 2007, 20:07 pm
Hola!
No tengo mucho tiempo y confio en que ustedes me ayuden con esto. Estoy haciendo un proyecto y mejorandolo, y lo que me dio el profesor contiene errores y no se cuales son la causa de estos, aqui pongo un screen del NetBeans:



Gracias de antemano, un saludo!


PD: Es codigo que genera solo el netbeans, asique no se...
6  Programación / PHP / funciones con Bases de datos similares a phpMyAdmin? en: 23 Mayo 2007, 14:43 pm
Hola!

Estoy haciendo un miniproyecto y tengo unas dudas porque nunca habia querido hacer esto antes, asique alla van:

Crear una base de datos
Ver todas las tablas de una base de datos
Ver todos los campos de una tabla
Contar todos las entradas de una tabla

Ahi estan, bueno, gracias de antemano, me voy que tengo prisilla!

PD: Si no he sido claro, ponedmelo aqui por favor!

S2!

*Edito:
Investigando se que para crear una base de datos se empieza asi:
CREATE DATABASE ...... DEFAULT...;
7  Programación / Java / Dudas con cosas graficas para mi simulacion de MSN en cutre :P (Help plz) en: 10 Mayo 2007, 21:49 pm
Hola!
Hace poco tiempo me meti con las interfaces graficas en java, usando netbeans (5.5), y no se mucho de usar cosas junto con las interfaces graficas, bueno, el problema es el siguiente, hoy me he puesto a hacer un MSN simulado y encima cutre :P, y tengo varios problemas a la hora de hacer cosillas, aqui os pongo los problemas:
Código:
Al hacer la lista de contactos, no se como se hace una tabla o como seria de agregar una fila o quitarla
No se poner imagenes
No se si se pueden poner imagenes de fondo en los JPanel, JText, JSelectBox, etc, y si se pone como se haria
No se si utilizo bien la accion de un JText para que actualize el nick o cualquier String o variable de ejemplar (o algo)
Y creo que nada mas.

Bueno, a continuacion os pongo el codigo del "programa" y el link con las instrucciones para ejecutar el .jar:
Código:
package wmsn;

import java.awt.event.*;
import javax.swing.*;

public class escritorio extends JFrame {
   
    // VARIABLES DE EJEMPLAR ________________________________________________________________
    String wmsnCFG_Nick;
    String wmsnCFG_PMessage;
    String wmsnCFG_Status;
    String wmsnCFG_C_Say;
    String wmsnCFG_C_MsgSent;
    String wmsnCFG_C_ClrMsg;
    String wmsnCFG_C_ConvAd;
    String wmsnCFG_C_JMsgrTitle;
    String wmsnCFG_C_CWindowTitle;
   
    /** Creates new form escritorio */
    public escritorio() {
        initComponents();
       
        // Configuracion de los textos...
            // Configuracion del perfil
            wmsnCFG_Nick           = "The Sixth Halcon";
            wmsnCFG_PMessage       = "Este es mi mensaje personal";
            String wmsnCFG_Status  = "Conectado";
           
            // Configuracion de otros textos
            wmsnCFG_C_Say          = " dice:";
            wmsnCFG_C_MsgSent      = "Mensaje enviado";
            wmsnCFG_C_ClrMsg       = "Texto borrado";
            wmsnCFG_C_ConvAd       = "No revele sus contraseñas a nadie. \n" +
                                     "______________________________";
            wmsnCFG_C_JMsgrTitle   = " - Java Messenger";
            wmsnCFG_C_CWindowTitle = "Contactos";
       
       
       
        // Configuracion media...
        int L_PMsg = wmsnCFG_PMessage.length();
        String a = "";
       
        if (!(L_PMsg <= 97)){
            L_PMsg = 97;
            a = "...";
        } //Fin if
        wmsnCFG_PMessage = wmsnCFG_PMessage.substring(0, L_PMsg)+a;
       
       
       
       
        // Configurando las ventanas...
            // Ventana de contactos
            wmsnContactsWindow.setTitle(wmsnCFG_C_CWindowTitle);
            wmsnNick.setText(wmsnCFG_Nick);
            wmsnPersonalMessage.setText(wmsnCFG_PMessage);
            wmsnStatus.setText(wmsnCFG_Status);
           
            // Ventana de conversacion
            wmsnChatWindow.setTitle(wmsnCFG_Nick+" -|"+wmsnCFG_Status+"|- "+wmsnCFG_C_JMsgrTitle);
            wmsn_T_PersonalMessage.setText(wmsnCFG_PMessage);
            wmsnConversation.setText(wmsnCFG_C_ConvAd);
    }
   
   
   
    // INICIO DE LOS METODOS ________________________________________________________________
    public void sendMessage(){
        String t = wmsnText.getText();
        String x = wmsnConversation.getText();
        wmsnConversation.setText(x+"\n"+wmsnCFG_Nick+wmsnCFG_C_Say+"\n"+t);
        wmsnText.setText("");
        wmsnConsole.setText(wmsnCFG_C_MsgSent);   
    }
   
    public void clearInput(){
        wmsnText.setText(""); 
        wmsnConsole.setText(wmsnCFG_C_ClrMsg);
    }
   
    public void changeNick(){
        String a = wmsnNick.getText(); 
        wmsnCFG_Nick = a;
    }
   
    public void changePMsg(){
        String a = wmsnPersonalMessage.getText(); 
        wmsnCFG_PMessage = a;
    }
       
    public void changeStatus(){
        String a = wmsnStatus.getText(); 
        wmsnCFG_Status = a;
    }
    // FIN DE LOS METODOS ___________________________________________________________________
   
   
   
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
    private void initComponents() {
        wmsnChatWindow = new javax.swing.JInternalFrame();
        jScrollPane1 = new javax.swing.JScrollPane();
        wmsnConversation = new javax.swing.JTextArea();
        jScrollPane2 = new javax.swing.JScrollPane();
        wmsnText = new javax.swing.JTextArea();
        wmsnSend = new javax.swing.JButton();
        wmsn_T_PersonalMessage = new javax.swing.JLabel();
        wmsnConsole = new javax.swing.JTextField();
        wmsnClearInput = new javax.swing.JButton();
        wmsnContactsWindow = new javax.swing.JInternalFrame();
        wmsn_JP_ProfileConfiguration = new javax.swing.JPanel();
        wmsnNick = new javax.swing.JTextField();
        wmsnPersonalMessage = new javax.swing.JTextField();
        wmsn_JP_Photo = new javax.swing.JPanel();
        wmsnStatus = new javax.swing.JTextField();
        wmsn_JP_ContactList = new javax.swing.JPanel();
        jTextField1 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        wmsnGeneralMenu = new javax.swing.JMenu();
        wmsn_GM_Exit = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("CutreMSN");
        wmsnChatWindow.setIconifiable(true);
        wmsnChatWindow.setMaximizable(true);
        wmsnChatWindow.setVisible(true);
        wmsnConversation.setColumns(20);
        wmsnConversation.setEditable(false);
        wmsnConversation.setRows(5);
        jScrollPane1.setViewportView(wmsnConversation);

        wmsnText.setColumns(20);
        wmsnText.setRows(5);
        jScrollPane2.setViewportView(wmsnText);

        wmsnSend.setText("Enviar");
        wmsnSend.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                wmsnSendActionPerformed(evt);
            }
        });

        wmsn_T_PersonalMessage.setForeground(new java.awt.Color(153, 153, 153));

        wmsnConsole.setBackground(new java.awt.Color(235, 233, 237));
        wmsnConsole.setEditable(false);
        wmsnConsole.setForeground(new java.awt.Color(153, 153, 153));
        wmsnConsole.setMargin(new java.awt.Insets(0, 0, 0, 0));

        wmsnClearInput.setText("Borrar");
        wmsnClearInput.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                wmsnClearInputActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout wmsnChatWindowLayout = new org.jdesktop.layout.GroupLayout(wmsnChatWindow.getContentPane());
        wmsnChatWindow.getContentPane().setLayout(wmsnChatWindowLayout);
        wmsnChatWindowLayout.setHorizontalGroup(
            wmsnChatWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, wmsnConsole, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 609, Short.MAX_VALUE)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, wmsnChatWindowLayout.createSequentialGroup()
                .addContainerGap()
                .add(wmsnChatWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE)
                    .add(wmsnChatWindowLayout.createSequentialGroup()
                        .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 474, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(wmsnChatWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(wmsnClearInput, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)
                            .add(wmsnSend, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE)))
                    .add(org.jdesktop.layout.GroupLayout.LEADING, wmsn_T_PersonalMessage, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 589, Short.MAX_VALUE))
                .addContainerGap())
        );
        wmsnChatWindowLayout.setVerticalGroup(
            wmsnChatWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wmsnChatWindowLayout.createSequentialGroup()
                .add(wmsn_T_PersonalMessage)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(wmsnChatWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 103, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, wmsnChatWindowLayout.createSequentialGroup()
                        .add(wmsnSend, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(wmsnClearInput)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(wmsnConsole, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );

        wmsnContactsWindow.setIconifiable(true);
        wmsnContactsWindow.setVisible(true);
        wmsn_JP_ProfileConfiguration.setBackground(new java.awt.Color(255, 255, 255));
        wmsn_JP_ProfileConfiguration.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        wmsnNick.setBackground(new java.awt.Color(235, 233, 237));
        wmsnNick.setMargin(new java.awt.Insets(0, 0, 0, 0));

        wmsnPersonalMessage.setBackground(new java.awt.Color(235, 233, 237));
        wmsnPersonalMessage.setMargin(new java.awt.Insets(0, 0, 0, 0));

        wmsn_JP_Photo.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        org.jdesktop.layout.GroupLayout wmsn_JP_PhotoLayout = new org.jdesktop.layout.GroupLayout(wmsn_JP_Photo);
        wmsn_JP_Photo.setLayout(wmsn_JP_PhotoLayout);
        wmsn_JP_PhotoLayout.setHorizontalGroup(
            wmsn_JP_PhotoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 69, Short.MAX_VALUE)
        );
        wmsn_JP_PhotoLayout.setVerticalGroup(
            wmsn_JP_PhotoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 66, Short.MAX_VALUE)
        );

        wmsnStatus.setBackground(new java.awt.Color(235, 233, 237));
        wmsnStatus.setMargin(new java.awt.Insets(0, 0, 0, 0));

        org.jdesktop.layout.GroupLayout wmsn_JP_ProfileConfigurationLayout = new org.jdesktop.layout.GroupLayout(wmsn_JP_ProfileConfiguration);
        wmsn_JP_ProfileConfiguration.setLayout(wmsn_JP_ProfileConfigurationLayout);
        wmsn_JP_ProfileConfigurationLayout.setHorizontalGroup(
            wmsn_JP_ProfileConfigurationLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, wmsn_JP_ProfileConfigurationLayout.createSequentialGroup()
                .add(wmsn_JP_Photo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(wmsn_JP_ProfileConfigurationLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(wmsnStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 162, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(wmsnNick, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)
                    .add(wmsnPersonalMessage, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE)))
        );
        wmsn_JP_ProfileConfigurationLayout.setVerticalGroup(
            wmsn_JP_ProfileConfigurationLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wmsn_JP_ProfileConfigurationLayout.createSequentialGroup()
                .add(wmsn_JP_ProfileConfigurationLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(wmsn_JP_ProfileConfigurationLayout.createSequentialGroup()
                        .add(wmsnNick, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(wmsnPersonalMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(wmsnStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(wmsn_JP_Photo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        wmsn_JP_ContactList.setBackground(new java.awt.Color(255, 255, 255));
        wmsn_JP_ContactList.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jTextField1.setBackground(new java.awt.Color(235, 233, 237));
        jTextField1.setText("Buscar un contacto");
        jTextField1.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jButton1.setText("+M");

        org.jdesktop.layout.GroupLayout wmsn_JP_ContactListLayout = new org.jdesktop.layout.GroupLayout(wmsn_JP_ContactList);
        wmsn_JP_ContactList.setLayout(wmsn_JP_ContactListLayout);
        wmsn_JP_ContactListLayout.setHorizontalGroup(
            wmsn_JP_ContactListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wmsn_JP_ContactListLayout.createSequentialGroup()
                .addContainerGap()
                .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 328, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jButton1)
                .addContainerGap())
        );
        wmsn_JP_ContactListLayout.setVerticalGroup(
            wmsn_JP_ContactListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wmsn_JP_ContactListLayout.createSequentialGroup()
                .add(wmsn_JP_ContactListLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jButton1)
                    .add(jTextField1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(469, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout wmsnContactsWindowLayout = new org.jdesktop.layout.GroupLayout(wmsnContactsWindow.getContentPane());
        wmsnContactsWindow.getContentPane().setLayout(wmsnContactsWindowLayout);
        wmsnContactsWindowLayout.setHorizontalGroup(
            wmsnContactsWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, wmsn_JP_ProfileConfiguration, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .add(wmsn_JP_ContactList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        wmsnContactsWindowLayout.setVerticalGroup(
            wmsnContactsWindowLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(wmsnContactsWindowLayout.createSequentialGroup()
                .add(wmsn_JP_ProfileConfiguration, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(wmsn_JP_ContactList, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        wmsnGeneralMenu.setText("Archivo");
        wmsn_GM_Exit.setText("Salir");
        wmsn_GM_Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                wmsn_GM_ExitActionPerformed(evt);
            }
        });

        wmsnGeneralMenu.add(wmsn_GM_Exit);

        jMenuBar1.add(wmsnGeneralMenu);

        setJMenuBar(jMenuBar1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(wmsnContactsWindow, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(wmsnChatWindow, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(166, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, wmsnChatWindow)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, wmsnContactsWindow))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>                       

    private void wmsn_GM_ExitActionPerformed(java.awt.event.ActionEvent evt) {                                             
        System.exit(0);
    }                                           

    private void wmsnClearInputActionPerformed(java.awt.event.ActionEvent evt) {                                               
        clearInput();
    }                                             

    private void wmsnSendActionPerformed(java.awt.event.ActionEvent evt) {                                         
        sendMessage();
    }                                       
   
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                JFrame frame = new escritorio();
                frame.setVisible(true);
            }
        });
    }
   
   
    // Variables declaration - do not modify                     
    private javax.swing.JButton jButton1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JInternalFrame wmsnChatWindow;
    private javax.swing.JButton wmsnClearInput;
    private javax.swing.JTextField wmsnConsole;
    private javax.swing.JInternalFrame wmsnContactsWindow;
    private javax.swing.JTextArea wmsnConversation;
    private javax.swing.JMenu wmsnGeneralMenu;
    private javax.swing.JTextField wmsnNick;
    private javax.swing.JTextField wmsnPersonalMessage;
    private javax.swing.JButton wmsnSend;
    private javax.swing.JTextField wmsnStatus;
    private javax.swing.JTextArea wmsnText;
    private javax.swing.JMenuItem wmsn_GM_Exit;
    private javax.swing.JPanel wmsn_JP_ContactList;
    private javax.swing.JPanel wmsn_JP_Photo;
    private javax.swing.JPanel wmsn_JP_ProfileConfiguration;
    private javax.swing.JLabel wmsn_T_PersonalMessage;
    // End of variables declaration                   
   
}


Y aqui os dejo el link del rar para que lo descomprimais, si no sabes como ejecutarlo dentro hay un txt con las instrucciones a seguir ;)
http://rapidshare.com/files/30597143/Java_MSN_Cutre.rar.html

Por si no fui concreto, querria que me explicarais como resolver las dudas que tengo.

Gracias de antemano!
8  Programación / PHP / Editor de archivos online en: 10 Abril 2007, 21:47 pm
Hola!
Vi un codigo para editar archivos online por internet y lo modifique a mi gusto y en algunos aspectos, como para que te leyese archivos de otras carpetas y otras cosillas mas para que funcionase bien, de momento me lee todos los archivos pero no me los guarda, y no se cual es el error (si es que lo hay).
Bien os explico como funciona:
Código:
editar.php?archivo=ARCHIVO.extension
editar.php?archivo=carpeta/carpeta/ARCHIVO.extension
Bien, el problema es que cuando le doy a guardar no sale la otra parte, se va a ella pero sigue saliendo la misma, la de editar el codigo, y no sale la de archivo guardado :S

A ver si me echais una manita, asias :)

Código:
<title>Editar un archivo</title>
<body topmargin="0" rightmargin="0" leftmargin="0">
<?php
$completo  = explode(".", $_GET[archivo]);
$archivo   = $completo[0];
$extension = $completo[1];
$dominio    = "rm.ayudapc.info"; // Bueno, aqui el dominio, pero es solo para hacer de bonito jeje

 function write_fil($arch, $titulo) {
 if ($fp = fopen($arch, "w")) {
        fwrite ($fp, stripslashes($titulo));
        fclose($fp);
        return 1;
        }
 else { return 0; }
        };

if($_GET[action] == ""){
$archi = "$archivo.$extension";
$abrir = @fopen($archi,"r");
$codigo = @fread($abrir, @filesize($archi));
@fclose($abrir);
?>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
font-family: Geneva, Arial, Helvetica, sans-serif;
font-size: 11px;
padding: 10px;
}
body {
background-color: #CCCCCC;
}
-->
</style>

<table width="100%" height="100%" border=1 bordercolor="#FFFFFF" cellpadding="0" cellspacing="0">
<tr><td>
<table border="0" width="100%" height="100%" cellpadding="4" cellspacing="1" >
  <tr>
    <td height="29" align="center" valign="top" bgcolor="#003399" >
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="2%" rowspan="2"><img src="http://tbn0.google.com/images?q=tbn:LPNqqdvcWV_H2M:http://www.negative99.com/images/dreamweaver_gray_sm.gif" /></td>
          <td width="98%"><div class="style1"> Editor online - [<?="http://".$dominio."/".$archivo.".".$extension ?>]</div></td>
        </tr>
        <tr>
          <td></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr valign="top">
    <td align="center" bgcolor="#666666" ><div align="left"><form method=post action='editar.php?action=ver&archivo=<?php echo $archivo.".".$extension ?>' id=form1 name=form1 enctype="multipart/form-data">
          <textarea name=descargar rows="42" class='form' style="width: 100%; height:90%;border:0px solid;"><?php echo $codigo ?></textarea>
          <br>
          <br>
          <input type='submit' name='enviar' value='Guardar' class='form'>
    </form>
    </div></td>
  </tr>
</table>
</td></tr>
</table>
<?php
nombre     = $_POST['descargar'];

}
else if($_GET[action] == "ver")
{
if (isset($descargar)&&($descargar!=""))
{
$rs = write_fil($archivo.".".$extension, "$descargar");
$archi = "$archivo.$extension";
$abrir = fopen($archi,"r");
$codigo = fread($abrir, filesize($archi));
fclose($abrir);
?>
<table border="1" width="100%" cellpadding="4" cellspacing="1" >
  <tr>
    <td height="29" align="center" ><div align="left">Editar <?php echo $archivo.".".$extension ?></div></td>
  </tr>
  <tr>
    <td height="2" align="center" ><div align="left">* Archivo modificado satisfactoriamente.</div></td>
  </tr>
</table>
<?php
}  }
?>
9  Foros Generales / Sugerencias y dudas sobre el Foro / Sobre los mensajes del foro en: 4 Abril 2007, 16:26 pm
Hola!
Llevo aqui un monton de tiempo y me ha extrañado una cosa, antes tenia 451 post y ahora solo 251, es normal? xD
No creo que ningun admin se haya dedicado a ir a por mi o a borrar mis mensajes, creo que sirven de ayuda xDD

Alguna respuesta!?

Saludos!

Edito:
por si sirve de algo, esto me acaba de pasar hoy mismo
10  Media / Multimedia / Algun programa para grabar del escritorio? (en Windows) en: 30 Marzo 2007, 22:59 pm
Pues eso que si hay alguno que me recomendeis que no sea el HyperCam qe con ese e tenido problemas porque se bloquea la computadora y todo eso asique nada,,, gracias de antemano!
Páginas: [1] 2 3
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines