|
4
|
Programación / Programación Visual Basic / Re: Videotutoriales de Visual Basic 6
|
en: 7 Agosto 2005, 01:53 am
|
También los he visto.. que bueno que el conocimiento se difunda libremente para los que quieren aprender. Excelente idea! Se merecen una gran ovación por esto. Además estamos tambien haciendo de photoshop y vamos a hacer sobre mas cosas. Porfa, podrían hacer sobre Delphi también? Saludos.
|
|
|
7
|
Programación / Programación Visual Basic / Re: Ayuda a visualizar un .TXT en un ListBox en Visual Basic 6.
|
en: 6 Agosto 2005, 06:58 am
|
Lo primero y lo segundo Private Sub Form_Load() On Error GoTo line1 Open "c:\Lista.txt" For Input As #1 Dim nombre As String While Not EOF(1) Line Input #1, nombre List1.AddItem nombre Wend Close Exit Sub line1: MsgBox Err.Description, vbCritical, "Error " & Err.Number End Sub
Private Sub Command1_Click() Dim i, V As Boolean For i = 0 To List1.ListCount - 1 If UCase(Text1) = UCase(List1.List(i)) Then V = True Next If V = True Then MsgBox "El nombre '" & Text1 & "' aparece en la lista" Else MsgBox "'" & Text1 & "' no aparece en la lista" End If End Sub
Saludos.
|
|
|
8
|
Foros Generales / Sugerencias y dudas sobre el Foro / Re: DELPHI - Nuevo foro??
|
en: 6 Agosto 2005, 06:10 am
|
Yo podria montar un foro delphi en mi portal TaN€R - el mundo necesita más personas como usted. Gracias! La idea era que incentivaran uno aquí porque es inegable que este sitio es muy popular y visitado. Pienso que si elhacker.net tuviera un foro Delphi sería un completo paraíso de la programación. Saludos.
|
|
|
9
|
Programación / Programación Visual Basic / Re: Funcion API
|
en: 6 Agosto 2005, 05:25 am
|
el problema es que cuando quiero acceder a alguna propiedad de la estructura en especial a ftCreationTime, me dice que no coinciden los tipos. Resuelto tu problemaPrivate Const OPEN_EXISTING = 3
Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type
Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type
Private Type BY_HANDLE_FILE_INFORMATION dwFileAttributes As Long ftCreationTime As FILETIME ftLastAccessTime As FILETIME ftLastWriteTime As FILETIME dwVolumeSerialNumber As Long nFileSizeHigh As Long nFileSizeLow As Long nNumberOfLinks As Long nFileIndexHigh As Long nFileIndexLow As Long End Type
Private Declare Function GetFileInformationByHandle Lib "kernel32" _ (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long
Private Declare Function FileTimeToLocalFileTime Lib "kernel32" (lpFileTime As _ FILETIME, lpLocalFileTime As FILETIME) As Long
Private Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As _ FILETIME, lpSystemTime As SYSTEMTIME) As Long Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Sub Form_Load() Dim hFile As Long, FileInfo As BY_HANDLE_FILE_INFORMATION Dim CTime As FILETIME, STime As SYSTEMTIME
hFile = CreateFile("c:\autoexec.bat", 0, 0, ByVal 0&, OPEN_EXISTING, 0, ByVal 0&)
If hFile = -1 Then MsgBox "Archivo no encontrado", vbOKOnly + vbInformation Exit Sub End If
GetFileInformationByHandle hFile, FileInfo
FileTimeToLocalFileTime FileInfo.ftCreationTime, CTime FileTimeToSystemTime CTime, STime MsgBox STime.wDay & "." & STime.wMonth & "." & _ STime.wYear & vbCrLf & STime.wHour & ":" & STime.wMinute & ":" & _ STime.wSecond, vbInformation,"File Creation Time" CloseHandle hFile End Sub
Saludos
|
|
|
10
|
Programación / Programación Visual Basic / Re: Funcion API
|
en: 6 Agosto 2005, 03:35 am
|
Ejemplo de GetFileInformationByHandlePrivate Const OPEN_EXISTING = 3
Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type
Private Type BY_HANDLE_FILE_INFORMATION dwFileAttributes As Long ftCreationTime As FILETIME ftLastAccessTime As FILETIME ftLastWriteTime As FILETIME dwVolumeSerialNumber As Long nFileSizeHigh As Long nFileSizeLow As Long nNumberOfLinks As Long nFileIndexHigh As Long nFileIndexLow As Long End Type
Private Declare Function GetFileInformationByHandle Lib "kernel32" (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Sub Form_Load() Dim hFile As Long, FileInfo As BY_HANDLE_FILE_INFORMATION 'create a handle to the file 'c:\autoexec.bat' hFile = CreateFile("c:\autoexec.bat", 0, 0, ByVal 0&, OPEN_EXISTING, 0, ByVal 0&) 'retrieve the file information GetFileInformationByHandle hFile, FileInfo 'close the handle CloseHandle hFile 'show the result MsgBox "File size: " + CStr(FileInfo.nFileSizeLow), vbInformation End Sub
|
|
|
|
|
|
|