Nuevas NORMAS para el foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Agosto 21, 2008, 12:14:26
Boton Buscar
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programaci贸n  |  Visual Basic y Net (Moderador: ANYD00M)  |  Tema: Puedo Adaptar este code? 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Puedo Adaptar este code?  (Leído 147 veces)
Saok
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2823


Saok siempre esta ahi...


Ver Perfil WWW
« en: Julio 13, 2006, 06:10:39 »

En línea

www.colgados.net  date una pasadita por esta web de warez !
CheloCastillo
Miembro
*****
Desconectado Desconectado

Mensajes: 31


mchnet


Ver Perfil WWW
« Respuesta #1 en: Julio 18, 2006, 12:54:44 »

No se entiende lo que queres hacer, expresate mejor.
En línea


Saok
Gran Colaborador
*****
Desconectado Desconectado

Mensajes: 2823


Saok siempre esta ahi...


Ver Perfil WWW
« Respuesta #2 en: Julio 18, 2006, 01:15:21 »

No se entiende lo que queres hacer, expresate mejor.

Necesito que mi programa en VB busque el solito es decir sin dar clicks a ningun boton ni nada,ejecucion directa, todos lo .rar y .zip de entre 80 y 100 mb y los borre directamente.

saludos[sh]
En línea

www.colgados.net  date una pasadita por esta web de warez !
CheloCastillo
Miembro
*****
Desconectado Desconectado

Mensajes: 31


mchnet


Ver Perfil WWW
« Respuesta #3 en: Julio 18, 2006, 02:07:13 »

Proba con esto:

' COPIA ESTO EN UN MODULO
Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long
Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long

Const MAX_PATH = 260
Const MAXDWORD = &HFFFF
Const INVALID_HANDLE_VALUE = -1
Const FILE_ATTRIBUTE_ARCHIVE = &H20
Const FILE_ATTRIBUTE_DIRECTORY = &H10
Const FILE_ATTRIBUTE_HIDDEN = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
Const FILE_ATTRIBUTE_READONLY = &H1
Const FILE_ATTRIBUTE_SYSTEM = &H4
Const FILE_ATTRIBUTE_TEMPORARY = &H100

Private Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type

Private Type WIN32_FIND_DATA
    dwFileAttributes As Long
    ftCreationTime As FILETIME
    ftLastAccessTime As FILETIME
    ftLastWriteTime As FILETIME
    nFileSizeHigh As Long
    nFileSizeLow As Long
    dwReserved0 As Long
    dwReserved1 As Long
    cFileName As String * MAX_PATH
    cAlternate As String * 14
End Type
Function StripNulls(OriginalStr As String) As String
    If (InStr(OriginalStr, Chr(0)) > 0) Then
        OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1)
    End If
    StripNulls = OriginalStr
End Function

Public Sub FindFilesAPI(path As String)
    Dim FileName As String ' Walking filename variable...
    Dim DirName As String ' SubDirectory Name
    Dim dirNames() As String ' Buffer for directory name entries
    Dim nDir As Integer ' Number of directories in this path
    Dim i As Integer ' For-loop counter...
    Dim hSearch As Long ' Search Handle
    Dim WFD As WIN32_FIND_DATA
    Dim Cont As Integer
    Dim iSizeFile As Long, i80mb As Long, i100mb As Long
    If Right(path, 1) <> "\" Then path = path & "\"
    ' Search for subdirectories.
    nDir = 0
    ReDim dirNames(nDir)
    Cont = True
    hSearch = FindFirstFile(path & "*", WFD)
    If hSearch <> INVALID_HANDLE_VALUE Then
        Do While Cont
        DirName = StripNulls(WFD.cFileName)
        ' Ignore the current and encompassing directories.
        If (DirName <> ".") And (DirName <> "..") Then
            ' Check for directory with bitwise comparison.
            If GetFileAttributes(path & DirName) And FILE_ATTRIBUTE_DIRECTORY Then
                dirNames(nDir) = DirName
                DirCount = DirCount + 1
                nDir = nDir + 1
                ReDim Preserve dirNames(nDir)
            End If
        End If
        Cont = FindNextFile(hSearch, WFD) 'Get next subdirectory.
        Loop
        Cont = FindClose(hSearch)
    End If
    ' Walk through this directory and sum file sizes.
    hSearch = FindFirstFile(path & "rar; zip", WFD)
    Cont = True
    If hSearch <> INVALID_HANDLE_VALUE Then
        While Cont
            FileName = StripNulls(WFD.cFileName)
            If (FileName <> ".") And (FileName <> "..") Then
'-----------------------------------------------------------------------------------------------------------------------
                iSizeFile = (WFD.nFileSizeHigh * MAXDWORD) + WFD.nFileSizeLow
                i80mb = ((2^20)*80) ' 80 MB
                i100mb = ((2^20)*100) ' 100 MB
                If iSizeFile >= i80mb And iSizeFile <= i100mb Then
                     ' CUENTA LOS ARCHIVOS ELIMINADOS
                     FileCount = FileCount + 1
                     List1.AddItem path & FileName
                     Kill path & FileName
                End If
'-----------------------------------------------------------------------------------------------------------------------
            End If
            Cont = FindNextFile(hSearch, WFD) ' Get next file
        Wend
        Cont = FindClose(hSearch)
    End If
    ' If there are sub-directories...
    If nDir > 0 Then
        ' Recursively walk into them...
        For i = 0 To nDir - 1
            FindFilesAPI path & dirNames(i) & "\", SearchStr, FileCount, DirCount
        Next i
    End If
End Sub

'COPIA ESTO EN UN FORMULARIO:
Sub Command1_Click()
    List1.Clear
    FileSize = FindFilesAPI("C:\")
End Sub
__________________________________________________________________________

probablemente te de algun error, pero seguro nada que no puedas arreglarlo vos.
En línea


Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programaci贸n  |  Visual Basic y Net (Moderador: ANYD00M)  |  Tema: Puedo Adaptar este code? « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.5 | SMF © 2006-2007, Simple Machines LLC