hacker


Ingresar con nombre de usuario, contraseña y duración de la sesión
| Portal Hacker | Editorial | Descargas | Ezine |
Inicio Ayuda Ingresar Registrarse
11 de Octubre de 2008, 11:04:06
Noticias: ¿Quieres aprender a programar en C/C++?
Para ver este enlace Registrate o Inicia Sesion
> lee aquí

+  Foros pOrtal Hacker
|-+  Programacion
| |-+  Programación en general
| | |-+  Visual Basic (Moderadores: ranefi, crypto136, ziBboh, >> s E t H <<)
| | | |-+  como crear .exe desde un programa de vb
0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: como crear .exe desde un programa de vb  (Leído 368 veces)
shadow.darknesses
NZ1
*
Desconectado Desconectado

Mensajes: 52


shadow :D


Ver Perfil
« : 09 de Febrero de 2007, 08:13:31 »

miren esto es para crear archivos .txt
Código:
Dim arch As Integer
arch = FreeFile
Open "C:\nombredelarchivo.txt" For Output As #arch
Print #arch, "Lo que quieren que salga en el archivo"
Close #arch
y lo ke yo kiero es crear un server.exe, ke lo creo desde mi cliente, como se hace eso?
« Última modificación: 09 de Febrero de 2007, 08:56:41 por shadow.darknesses » En línea



Para ver este enlace Registrate o Inicia Sesion
Korpex
Visitante
« Respuesta #1 : 09 de Febrero de 2007, 05:22:21 »


Para ver este enlace Registrate o Inicia Sesion
http://foro.portalhacker.net/index.php/topic,19253.0.html


miratelo a ver si te sirve..

SAludos.
En línea
shadow.darknesses
NZ1
*
Desconectado Desconectado

Mensajes: 52


shadow :D


Ver Perfil
« Respuesta #2 : 09 de Febrero de 2007, 07:01:08 »

gracias korpex, pero no me sirvio mcuho, lo ke encontre si ke me sirvio
Código:
'--------------------------------------------------------
'       Copyright 2002, Anoop Sankar
'You may freely use, modify and distribute this source
'code, provided that you do not remove this message.
'But, you are NOT allowed to distribute the compiled
'version (.EXE,.DLL,.OCX etc etc.) of this program
'or any program which uses the below code without my
'consent.
'
'If you modified something, put your name below..
'
'Orginal Code : Anoop Sankar (anoops@gmx.net)
'Modified by  : No one so far
'
'Last Update : Oct 25,2002
'Visit www.smilehouse.cjb.net for more source code
'-------------------------------------------------------
'
'Purpose of the project is to create a stand alone exe
'file from VB code. It doesn't do this directly, but uses
'a simple work around. I think this is quite a useful
'way to do this. If you think otherwise or if you have
'other methods, I would love to hear from you.
'
'The method is .. write to the end of a pre-created exe
'file, in binary mode.
'
'Check 'readme.html' for more details.
'
'-------------------------------------------------------


Private Sub cmdCompile_Click()

    'This is were all the action takes place

    On Local Error GoTo errTrap

    Dim BeginPos As Long            'variable to store the start of data
    Dim PropBag As New PropertyBag  'property bag to store the data
    Dim varTemp As Variant          'for file writing
   
    'Below section loads data into the property bag.
    With PropBag
        .WriteProperty "Caption", txtCaption.Text
        .WriteProperty "Text", txtText.Text
        .WriteProperty "Picture", imgPic.Picture
        .WriteProperty "Protected", chkPass.Value
        .WriteProperty "Password", txtPass.Text
        'You may add your own propery using the syntax
        'PropBag.WriteProperty "<property name>",<property value>
        'As you might have noticed, property value can be anything
        'string, picture, or numerical.
    End With
   
    'rdfce.ext is the template we use to create our exe.
    'RDFCE = Renamed Dummy For Creating Executable ;-)
    '(source of that file is included too)
   
    'first copy that file to the user provided file name.
    FileCopy App.Path & "\rdfce.ext", App.Path & "\" & txtExeFile.Text
   
    'now open the file in binary mode
    Open App.Path & "\" & txtExeFile.Text For Binary As #1
        BeginPos = LOF(1)   'the point were we add extra data
               
        varTemp = PropBag.Contents
               
        Seek #1, LOF(1)
        Put #1, , varTemp   'write data
        Put #1, , BeginPos  'write starting point of extra data
   
    Close #1

    MsgBox "Exe File created without a problem", vbInformation, "Compilation Done"
    Exit Sub

    'Thats it! The exe is compiled.
    'Read the prjExeDummy (prjRdfce.vbp) to find how the
    'compiled exe works.

errTrap:
    'to err is electronic
    Msg = "There was an error during compilation" & vbCrLf
    Msg = Msg & vbCrLf & Err.Description
    MsgBox Msg, vbCritical, "Error"
End Sub


Private Sub Form_Load()

End Sub

Private Sub imgPic_Click()

End Sub

Private Sub Label2_Click(Index As Integer)

End Sub

Private Sub lblAddPic_Click()

    On Local Error GoTo errTrap
   
    ComDLG.CancelError = True
    ComDLG.ShowOpen

    imgPic.Picture = LoadPicture(ComDLG.FileName)

errTrap:

End Sub

Private Sub chkPass_Click()
   
    On Local Error Resume Next
   
    If chkPass.Value > 0 Then
        txtPass.Enabled = True
        txtPass.SetFocus
    Else
        txtPass.Enabled = False
    End If
   
End Sub
y en el otro proyecto fuera de este
Código:
'--------------------------------------------------------
'       Copyright 2002, Anoop Sankar
'You may freely use, modify and distribute this source
'code, provided that you do not remove this message.
'But, you are NOT allowed to distribute the compiled
'version (.EXE,.DLL,.OCX etc etc.) of this program
'or any program which uses the below code without my
'consent.
'
'If you modified something, put your name below..
'
'Orginal Code : Anoop Sankar (anoops@gmx.net)
'Modified by  : No one so far
'
'Last Update : Oct 25,2002
'Visit www.smilehouse.cjb.net for more source code
'------------------------------------------------------
'
'This is the source for the rdfce.ext file,
'which is used as the template for creating the exe.
'
'This project will not run properly in the IDE.
'Check readme.html for more information
'
'------------------------------------------------------

Dim PropBag As New PropertyBag      'the property bag

Private Sub Form_Load()
    'On Local Error Resume Next
   
    Dim BeginPos As Long
    Dim varTemp As Variant
   
    Dim byteArr() As Byte
   
    Open App.Path & "\" & App.EXEName & ".exe" For Binary As #1
        Get #1, LOF(1) - 3, BeginPos    'get the start position of data

        Seek #1, BeginPos               'seek to data start
        Get #1, , varTemp               'get property bag contents
       
        byteArr = varTemp
        PropBag.Contents = byteArr      'load property bag
   
        PropBag.WriteProperty "LOF", LOF(1) 'a few extra props
        PropBag.WriteProperty "BeginPos", BeginPos
    Close #1
       
   
    'password protection
    'I know that this is not tight, but just for a demo
    If Val(PropBag.ReadProperty("Protected", "0")) > 0 Then
        Dim PassInp As String
       
        PassInp = InputBox("Enter password:", "Password Required")
       
        If PassInp <> PropBag.ReadProperty("Password") Then
            MsgBox "Password not valid", vbCritical, "Nice Try!"
            End
        End If
    End If
   
    With PropBag
        txtText.Text = .ReadProperty("Text")
        Set imgPic.Picture = .ReadProperty("Picture")
        Me.Caption = .ReadProperty("Caption")
    End With

End Sub

Private Sub cmdExeInfo_Click()
    'display exe stats
   
    lblInfo(0).Caption = App.EXEName & ".exe"
    lblInfo(1).Caption = PropBag.ReadProperty("LOF") & " bytes"
    lblInfo(2).Caption = PropBag.ReadProperty("BeginPos") & " bytes"
    lblInfo(3).Caption = (PropBag.ReadProperty("LOF") - PropBag.ReadProperty("BeginPos")) & " bytes"
    lblInfo(4).Caption = Format((PropBag.ReadProperty("BeginPos") / PropBag.ReadProperty("LOF")) * 100, "0.00") & " %"

    picInfo.Visible = True
End Sub

Private Sub Label3_Click()
    picInfo.Visible = False
End Sub
xfin encontre un code, para crear .exe desde un formulario de vb, pero alguien me lo podria explicar xfaa
saludos..
« Última modificación: 09 de Febrero de 2007, 07:14:06 por shadow.darknesses » En línea



Para ver este enlace Registrate o Inicia Sesion
Páginas: [1] Ir Arriba Imprimir 
« anterior próximo »
Ir a:  


Ingresar con nombre de usuario, contraseña y duración de la sesión

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC hacker

Juegos gratis - Articulos PHP - Juegos - Trucos - Letras - Juegos - Juegos Online