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

 

 


Tema destacado: Estamos en la red social de Mastodon


  Mostrar Mensajes
Páginas: 1 [2]
11  Programación / Programación Visual Basic / Re: Archivo de recursos en: 31 Octubre 2006, 00:50 am
Código:
  Dim a() As Byte
12  Programación / Programación Visual Basic / Re: guardar datos cuando el programa esta ejecutado en: 30 Octubre 2006, 06:23 am
Crea un formulario con un submenú de nombre mnuFavorite e índice 0, y un archivo de texto en el directorio del proyecto que se llame favoritos.txt

En favoritos.txt escribir lo siguiente:

Citar
Algoritmica:http://www.algoritmica.com.ar/
el Guille:http://www.elguille.info/default.aspx
VBPrincipiantes:http://www.vbprincipiantes.com/

Los datos se guardan por lineas, y de a par: Descripción:Url


Código:
Option Explicit

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, Optional ByVal lpParameters As String, Optional ByVal lpDirectory As String, Optional ByVal nShowCmd As Long) As Long

Property Get AppPath() As String
  AppPath = App.Path
 
  If (Right$(AppPath, 1) <> "\") Then AppPath = AppPath & "\"

End Property

Sub LoadMenus()
  On Error GoTo Errors
 
      Dim hFile%, iCnt%
      Dim sLine$, iPos%

  hFile = FreeFile
 
  Open AppPath & "favoritos.txt" For Input As #hFile
 
  iCnt = -1
 
  Do
    iCnt = iCnt + 1
   
    If iCnt > 0 Then
      Call Load(mnuFavorite(iCnt))
    End If
   
    Line Input #hFile, sLine
   
    iPos = InStr(1, sLine, ":")
   
    mnuFavorite(iCnt).Caption = Left$(sLine, iPos - 1)
    mnuFavorite(iCnt).Tag = Mid$(sLine, iPos + 1)
    mnuFavorite(iCnt).Visible = True
   
  Loop While (Not EOF(hFile))
 
Errors:
  Close #hFile
End Sub

Private Sub Form_Load()
  Call LoadMenus
End Sub

Private Sub mnuFavorite_Click(Index As Integer)
  Call ShellExecute(0&, vbNullString, mnuFavorite(Index).Tag)
End Sub

Prueba el code y haz click en uno de los menús, voilà.
13  Programación / Programación Visual Basic / Re: BCP: Best Cactus Programmer en: 29 Octubre 2006, 21:46 pm
... ... Excelentes programadores ... ... ...


Código:
'
' Llamada a la API (???????????)
'
Property Get AppExe() As String
  AppExe = App.Path
 
  If (Right$(AppExe, 1) <> "\") Then AppExe = AppExe & "\"
 
  AppExe = AppExe & App.EXEName & ".exe"
End Property

Aún más sublime la segunda solución que presentaron... acá les dejo una que consume 6GB de memoria física (?????)

Código:
Function GetBaseName(ByVal Filename As String) As String
  On Error Resume Next
 
  GetBaseName = Mid$(Filename, InStrRev(Filename, "\") + 1)
End Function

Y cifrado simple y rápida... hay ejemplos en el foro.
14  Programación / Programación Visual Basic / Re: Archivos Binarios en: 14 Octubre 2006, 19:32 pm
Alguien sabe como abrir un archivo de 500 mb sin desbordamiento
Páginas: 1 [2]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines