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

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: 1 ... 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 [47] 48 49 50 51 52 53
461  Programación / Programación Visual Basic / Re: ayundeme con este simple codigo en: 13 Octubre 2006, 14:20 pm
la otra forma de hacerlo seria iniciando tu proyecto desde un Sub Main

agrega un modulo y pones:

Public Sub Main()

    Dim x As Form
   
    Set x = New Form1
   
    x.Show

End Sub

y en el form1:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    If UnloadMode = 0 Then Main
End Sub
462  Programación / Programación Visual Basic / Re: common dialog abrir/seleccionar mas de un fichero en: 12 Octubre 2006, 23:39 pm
hay te va el codigo mejorado

            Dim s() As String, i As Integer
           
            On Local Error Resume Next
            With CommonDialog1
                .Flags = cdlOFNAllowMultiselect
                .Filter = "Todos los archivos | *.*"
                .ShowOpen
                Select Case Err.Number
                    Case 0 ' archivos seleccionados
                        s = Split(.FileName, " ")
                        For i = 1 To UBound(s)
                            MsgBox s(0) & s(i)
                        Next i
                    Case 32755
                        ' selecciono cancelar
                    Case Else
                        MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error al abrir"
                End Select
            End With
            On Local Error GoTo 0
463  Programación / Programación Visual Basic / Re: common dialog abrir/seleccionar mas de un fichero en: 12 Octubre 2006, 23:35 pm
lo puedes hacer con la propiedad "Flags"

            On Local Error Resume Next
            With CommonDialog1
                .Flags = cdlOFNAllowMultiselect
                .Filter = "Todos los archivos | *.*"
                .ShowOpen
                Select Case Err.Number
                    Case 0
                        MsgBox .FileName ' archivos seleccionados
                    Case 32755
                        ' selecciono cancelar
                    Case Else
                        MsgBox Err.Number & vbCrLf & Err.Description, vbCritical + vbOKOnly, "Error al abrir"
                End Select
            End With
464  Programación / Programación Visual Basic / Re: de imagen a string en: 12 Octubre 2006, 20:04 pm
como de que no se puede guardar fotos, he utilizado las base de access y claro que se puede, solo que debes de tener el SP4 o postrerior del visual instalado
465  Programación / Programación Visual Basic / Re: DUDA ACERCA DE LA EJECUCION DE LOS PROGRAMAS en: 12 Octubre 2006, 14:21 pm
SI TE REFIERES A QUE CREAS UN EJECUTABLE EN TU PC Y LO PONES EN OTRO A VECES NO CORREN O TE MARCA QUE LE FALTAN ARCHIVOS, ESTO OCURRE PORQUE EL EJECUTABLE CON EL QUE ESTAS TRABAJANDO NO FUNCIONA SOLITO, ES DECIR, NECESITA DE OTROS ARCHIVOS COMO OCXs, DLLs Y/O ARCHIVOS ALOS QUE HAGAS REFERENCIA (BASES DE DATOS, ARCHIVOS DE TEXTO, ETC),   LO QUE PUEDES HACER ES GENERAR UN PAQUETE DE INSTALACION E INSTALAR TU PROGRAMA EN LAS PCs QUE NECESITES QUE CORRA.
466  Programación / Programación Visual Basic / Re: Correo desde Visual Basic???? en: 11 Octubre 2006, 22:52 pm
hay les va el código....
agrege un cotrol de usuario y en el puse un winsock(wsMail),  5 textbox(txtServidor, txtDe, txtPara, txtAsunto y txtMensaje) y un xpcmdbutton(cmdEnviar)

Código:
'Event Declarations:
Event Enviar() 'MappingInfo=cmdEnviar,cmdEnviar,-1,Click

Código:
Private Sub cmdEnviar_Click()
    RaiseEvent Enviar
    wsMail.RemoteHost = txtServidor.Text
    wsMail.RemotePort = 25
    wsMail.Connect

End Sub

Código:
Private Sub UserControl_Resize()
    On Local Error Resume Next
    txtServidor.Width = UserControl.ScaleWidth - txtServidor.Left * 2
    txtDe.Width = UserControl.ScaleWidth - txtServidor.Left * 2
    txtPara.Width = UserControl.ScaleWidth - txtServidor.Left * 2
    txtAsunto.Width = UserControl.ScaleWidth - txtServidor.Left * 2
    txtMensaje.Width = UserControl.ScaleWidth - txtServidor.Left * 2
    txtMensaje.Height = UserControl.ScaleHeight - txtMensaje.Top - 540
    cmdEnviar.Top = txtMensaje.Top + txtMensaje.Height + 100
    cmdEnviar.Left = UserControl.ScaleWidth - cmdEnviar.Width - 100
   
    txStatus.Width = UserControl.ScaleWidth
    txStatus.Top = UserControl.ScaleHeight - txStatus.Height
    On Local Error Resume Next
End Sub

Código:
Private Sub wsMail_DataArrival(ByVal bytesTotal As Long)
    '   this is the main processing code for
    '   sending an email message
    '   the iState variable maintains the current
    '   state of the protocol exchange so that we
    '   know what to send next
    Dim strData As String
    Static iState       As Integer
    Dim iMsgNum         As Integer
    Dim szMsg           As String
    Dim I               As Integer
   
    wsMail.GetData strData, vbString
   
    iMsgNum = Val(Left(strData, InStr(strData, " ")))
   
    Select Case iMsgNum
        Case 220    '   initial message
            wsMail.SendData "HELO " & txtServidor.Text & vbCrLf
            txStatus = "Servidor de correo conectado..."
            iState = 1
        Case 221
            If iState = 999 Then
                txStatus = "Desconectado del servidor de coreo con errores..."
            Else
                txStatus = "Desconectado del servidor de coreo..."
            End If
            iState = 0
           
        Case 250
            Select Case iState
                Case 1:
                    wsMail.SendData "MAIL FROM:<" & txtDe.Text & ">" & vbCrLf
                    'Debug.Print "MAIL FROM:<" & txtMail.Text & ">" & vbCrLf
                    txStatus = "Enviando comando FROM..."
                    iState = 2
               
                Case 2:
                    wsMail.SendData "RCPT TO:<" & txtPara.Text & ">" & vbCrLf
                    'Debug.Print "RCPT TO:<ocelaya@embzacatecas.com>" & vbCrLf
                    txStatus = "Enviando comando RCPT..."
                    iState = 3
                   
                Case 3:
                    wsMail.SendData "DATA" & vbCrLf
                    'Debug.Print "DATA" & vbCrLf
                    txStatus = "Enviando comando DATA..."
                    iState = 4
                   
                Case 5:
                    wsMail.SendData "QUIT" & vbCrLf
                    'Debug.Print "QUIT" & vbCrLf
                    txStatus = "Enviando comando Quit para desconecar del servidor de correo..."
                    iState = 6
                    wsMail.Close
                   
                    MsgBox "Su correo ha sido enviado correctamente.", vbInformation + vbOKOnly, "Soporte técnico"
                   
                End Select
               
        Case 354
            iState = 5
            szMsg = txtMensaje.Text + Chr(10)
            txStatus = "Sending mail message data..."
            wsMail.SendData "Subject: " & txtAsunto.Text & vbCrLf
            While szMsg <> ""
                wsMail.SendData Left(szMsg, InStr(szMsg, Chr(10)))
                'Debug.Print "Sending:" & Left(szMsg, InStr(szMsg, Chr(10)))
                szMsg = Mid(szMsg, InStr(szMsg, Chr(10)) + 1)
                Wend
            wsMail.SendData "." & vbCrLf
           
        Case 500 To 599
            wsMail.SendData "QUIT" & vbCrLf

            txStatus = "Error al enviar el correo..."
            'Debug.Print "Error sending mail... quitting..."
            iState = 999
           
        End Select

End Sub

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,BackColor
Código:
Public Property Get BackColor() As OLE_COLOR
    BackColor = UserControl.BackColor
End Property

Código:
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
    UserControl.BackColor() = New_BackColor
    PropertyChanged "BackColor"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,ForeColor
Código:
Public Property Get ForeColor() As OLE_COLOR
    ForeColor = UserControl.ForeColor
End Property

Código:
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
    UserControl.ForeColor() = New_ForeColor
    PropertyChanged "ForeColor"
   
    txtServidor.ForeColor = New_ForeColor
    txtDe.ForeColor = New_ForeColor
    txtPara.ForeColor = New_ForeColor
    txtAsunto.ForeColor = New_ForeColor
    txtMensaje.ForeColor = New_ForeColor
    lblServidor.ForeColor = New_ForeColor
    lblDe.ForeColor = New_ForeColor
    lblPara.ForeColor = New_ForeColor
    lblAsunto.ForeColor = New_ForeColor
    lblMensaje.ForeColor = New_ForeColor

   
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,Enabled
Código:
Public Property Get Enabled() As Boolean
    Enabled = UserControl.Enabled
End Property

Código:
Public Property Let Enabled(ByVal New_Enabled As Boolean)
    UserControl.Enabled() = New_Enabled
    PropertyChanged "Enabled"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,Font
Código:
Public Property Get Font() As Font
    Set Font = UserControl.Font
End Property

Código:
Public Property Set Font(ByVal New_Font As Font)
    Set UserControl.Font = New_Font
    PropertyChanged "Font"
   
    txtServidor.Font = New_Font
    txtDe.Font = New_Font
    txtPara.Font = New_Font
    txtAsunto.Font = New_Font
    txtMensaje.Font = New_Font
    lblServidor.Font = New_Font
    lblDe.Font = New_Font
    lblPara.Font = New_Font
    lblAsunto.Font = New_Font
    lblMensaje.Font = New_Font
   
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,Appearance
Código:
Public Property Get Appearance() As Integer
    Appearance = UserControl.Appearance
End Property

Código:
Public Property Let Appearance(ByVal New_Appearance As Integer)
    UserControl.Appearance() = New_Appearance
    PropertyChanged "Appearance"
   
    txtServidor.Appearance = New_Appearance
    txtDe.Appearance = New_Appearance
    txtPara.Appearance = New_Appearance
    txtAsunto.Appearance = New_Appearance
    txtMensaje.Appearance = New_Appearance
   
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,BackStyle
Código:
Public Property Get BackStyle() As Integer
    BackStyle = UserControl.BackStyle
End Property

Código:
Public Property Let BackStyle(ByVal New_BackStyle As Integer)
    UserControl.BackStyle() = New_BackStyle
    PropertyChanged "BackStyle"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,BorderStyle
Código:
Public Property Get BorderStyle() As Integer
    BorderStyle = UserControl.BorderStyle
End Property

Código:
Public Property Let BorderStyle(ByVal New_BorderStyle As Integer)
    UserControl.BorderStyle() = New_BorderStyle
    PropertyChanged "BorderStyle"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=UserControl,UserControl,-1,Refresh
Código:
Public Sub Refresh()
    UserControl.Refresh
End Sub

'Inicializar propiedades para control de usuario
Código:
Private Sub UserControl_InitProperties()
    Set UserControl.Font = Ambient.Font
End Sub

'Cargar valores de propiedad desde el almacén
Código:
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

    UserControl.BackColor = PropBag.ReadProperty("BackColor", &H8000000F)
    UserControl.ForeColor = PropBag.ReadProperty("ForeColor", &H80000012)
    UserControl.Enabled = PropBag.ReadProperty("Enabled", Verdadero)
    Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
    UserControl.Appearance = PropBag.ReadProperty("Appearance", 1)
    UserControl.BackStyle = PropBag.ReadProperty("BackStyle", 1)
    UserControl.BorderStyle = PropBag.ReadProperty("BorderStyle", 0)
    txtServidor.Text = PropBag.ReadProperty("Servidor", "")
    txtDe.Text = PropBag.ReadProperty("De", "")
    txtPara.Text = PropBag.ReadProperty("Para", "")
    txtAsunto.Text = PropBag.ReadProperty("Asunto", "")
    txtMensaje.Text = PropBag.ReadProperty("Mensaje", "")
End Sub

'Escribir valores de propiedad en el almacén
Código:
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

    Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &H8000000F)
    Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &H80000012)
    Call PropBag.WriteProperty("Enabled", UserControl.Enabled, Verdadero)
    Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
    Call PropBag.WriteProperty("Appearance", UserControl.Appearance, 1)
    Call PropBag.WriteProperty("BackStyle", UserControl.BackStyle, 1)
    Call PropBag.WriteProperty("BorderStyle", UserControl.BorderStyle, 0)
    Call PropBag.WriteProperty("Servidor", txtServidor.Text, "")
    Call PropBag.WriteProperty("De", txtDe.Text, "")
    Call PropBag.WriteProperty("Para", txtPara.Text, "")
    Call PropBag.WriteProperty("Asunto", txtAsunto.Text, "")
    Call PropBag.WriteProperty("Mensaje", txtMensaje.Text, "")
End Sub

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=txtServidor,txtServidor,-1,Text
Código:
Public Property Get Servidor() As String
    Servidor = txtServidor.Text
End Property

Código:
Public Property Let Servidor(ByVal New_Servidor As String)
    txtServidor.Text() = New_Servidor
    PropertyChanged "Servidor"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=txtDe,txtDe,-1,Text
Código:
Public Property Get De() As String
    De = txtDe.Text
End Property

Código:
Public Property Let De(ByVal New_De As String)
    txtDe.Text() = New_De
    PropertyChanged "De"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=txtPara,txtPara,-1,Text
Código:
Public Property Get Para() As String
    Para = txtPara.Text
End Property

Código:
Public Property Let Para(ByVal New_Para As String)
    txtPara.Text() = New_Para
    PropertyChanged "Para"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=txtAsunto,txtAsunto,-1,Text
Código:
Public Property Get Asunto() As String
    Asunto = txtAsunto.Text
End Property

Código:
Public Property Let Asunto(ByVal New_Asunto As String)
    txtAsunto.Text() = New_Asunto
    PropertyChanged "Asunto"
End Property

'ADVERTENCIA: NO QUITAR NI MODIFICAR LAS SIGUIENTES LINEAS CON COMENTARIOS
'MappingInfo=txtMensaje,txtMensaje,-1,Text
Código:
Public Property Get Mensaje() As String
    Mensaje = txtMensaje.Text
End Property

Código:
Public Property Let Mensaje(ByVal New_Mensaje As String)
    txtMensaje.Text() = New_Mensaje
    PropertyChanged "Mensaje"
End Property

467  Programación / Programación Visual Basic / Re: Correo desde Visual Basic???? en: 11 Octubre 2006, 17:17 pm
bueno ya lo puse aqui, es un ocx muy sencillo, voy a tratar de ir agregando cosas, si a alguien se le ocurre algo pues vemos como lo modificamos

http://www.geocities.com/cero780814/EnviarCorreo.zip
468  Programación / Programación Visual Basic / Re: gif animados en visual basic??? en: 11 Octubre 2006, 17:02 pm
hay una dll que hace eso, se llama gif89.dll la tienes que agregar como componente para que te aparezca en la barra de controloes, es una especie de PictureBox nada mas le pones que imagen va y listo
469  Programación / Programación Visual Basic / Re: alinear datos en un list box en: 11 Octubre 2006, 16:59 pm
checate esta pagina a ver si te sirve

http://www.elguille.info/colabora/vb2006/karmany_centrartextolistbox.htm
470  Programación / Programación Visual Basic / Re: ayuda porfavor (algo de socket) en: 10 Octubre 2006, 23:44 pm
recuerda que split te separa por palabras lo que debes hacer es meterle un espacio al mensaje


ws.SendData destino & " " &  mensaje
Páginas: 1 ... 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 [47] 48 49 50 51 52 53
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines