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

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  bUSCAR ARCHIVOS
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: bUSCAR ARCHIVOS  (Leído 1,408 veces)
pungados

Desconectado Desconectado

Mensajes: 90



Ver Perfil
bUSCAR ARCHIVOS
« en: 14 Octubre 2007, 14:56 pm »

Hola gente
Alguno sabe como hacer un buscador de archivos en vb? o si hay un *.OSX que lo haga me lo puede decir?
Muchas gracias.  ;D


En línea

~~
Ex-Staff
*
Desconectado Desconectado

Mensajes: 2.981


Ver Perfil WWW
Re: bUSCAR ARCHIVOS
« Respuesta #1 en: 14 Octubre 2007, 18:55 pm »

No hace falta ningun OCX, con la api SearchTreeForFile lo tienes arreglado, mirate la info del api guide ;)


En línea

Surfiction

Desconectado Desconectado

Mensajes: 20


Ver Perfil
Re: bUSCAR ARCHIVOS
« Respuesta #2 en: 19 Octubre 2007, 07:30 am »

Espero te sirva...

Código:
Option Explicit On
Module buscar


    Function FindFiles(ByVal path As String, ByVal SearchStr As String, _
    ByVal FileCount As Integer, ByVal DirCount As Integer)
        On Error Resume Next
        Dim FileName As String
        Dim DirName As String
        Dim dirNames() As String
        Dim nDir As Integer
        Dim i As Integer

        On Error GoTo sysFileERR
        If Right(path, 1) <> "\" Then path = path & "\"

        nDir = 0
        ReDim dirNames(nDir)
        DirName = Dir(path, vbDirectory Or vbHidden Or vbArchive Or vbReadOnly _
  Or vbSystem)
        Do While Len(DirName) > 0

            If (DirName <> ".") And (DirName <> "..") Then

                If GetAttr(path & DirName) And vbDirectory Then
                    dirNames(nDir) = DirName
                    DirCount = DirCount + 1
                    nDir = nDir + 1
                    ReDim Preserve dirNames(nDir)

                End If
sysFileERRCont:
            End If
            DirName = Dir()
        Loop


        FileName = Dir(path & SearchStr, vbNormal Or vbHidden Or vbSystem _
        Or vbReadOnly Or vbArchive)
        While Len(FileName) <> 0
            FindFiles = FindFiles + FileLen(path & FileName)
            FileCount = FileCount + 1

'en este caso agrega los resultados en un listview

            inicio.listview1.Items.Add(path & FileName)
           
            FileName = Dir()
        End While


        If nDir > 0 Then

            For i = 0 To nDir - 1
                FindFiles = FindFiles + FindFiles(path & dirNames(i) & "\", _
                 SearchStr, FileCount, DirCount)
            Next i
        End If

AbortFunction:
        Exit Function
sysFileERR:
        If Right(DirName, 4) = ".sys" Then
            Resume sysFileERRCont
        Else
            MsgBox("Error: " & Err.Number & " - " & Err.Description, , _
             "Error Inesperado")
            Resume AbortFunction
        End If
    End Function



End Module
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
buscar archivos por terminal
GNU/Linux
th3b4g 5 3,101 Último mensaje 22 Diciembre 2011, 09:03 am
por Slava_TZD
Duda: CMD, buscar archivos de mes a mes
Scripting
seant23468 0 1,541 Último mensaje 5 Diciembre 2015, 21:38 pm
por seant23468
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines