Nuevas NORMAS para el foro
Bienvenido(a),
Visitante
. Favor de
ingresar
o
registrarse
.
¿Perdiste tu
email de activación?
- Agosto 21, 2008, 12:14:26
Boton Buscar
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
]
Autor
Tema: Puedo Adaptar este code? (Leído 147 veces)
Saok
Gran Colaborador
Desconectado
Mensajes: 2823
Saok siempre esta ahi...
Puedo Adaptar este code?
«
en:
Julio 13, 2006, 06:10:39 »
En línea
www.colgados.net
date una pasadita por esta web de warez !
CheloCastillo
Miembro
Desconectado
Mensajes: 31
mchnet
Re: Puedo Adaptar este code?
«
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
Mensajes: 2823
Saok siempre esta ahi...
Re: Puedo Adaptar este code?
«
Respuesta #2 en:
Julio 18, 2006, 01:15:21 »
Cita de: CheloCastillo en Julio 18, 2006, 12:54:44
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
Mensajes: 31
mchnet
Re: Puedo Adaptar este code?
«
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
]
Comunidad Underground Hispana
|
Programacion
|
Programaci贸n
|
Visual Basic y Net
(Moderador:
ANYD00M
) | Tema:
Puedo Adaptar este code?
« anterior
próximo »
Ir a:
Por favor selecciona un destino:
-----------------------------
Foros De Consulta General
-----------------------------
=> Novedades
=> Dudas, Comentarios Y Sugerencias
=> Top 100
=> Off-Topic
=> Revista E-Zine
===> Noticias
-----------------------------
Phreaking, Hacking y Seguridad
-----------------------------
=> HacK GeneraL
===> Ingenieria Inversa
===> Encriptacion, Cryptografia
===> TV HACK
===> Seguridad
===> Cursos y Ezines
=====> Trucos Internet
=====> Textos Hacking
===> Defacing
=> Phreaking
===> Moviles
=> Bug y Exploits
-----------------------------
Hack Novato
-----------------------------
=> Hack para newbies
=> Todo Messenger
=> Troyanos y virus
-----------------------------
Sistemas Operativos
-----------------------------
=> Windows y otros sistemas operativos no libres
===> Problemas Tecnicos Windows
=> Sistemas operativos libres.
===> GNU/Linux
===> Manuales y Tutoriales
===> Descargas
-----------------------------
Programacion
-----------------------------
=> Programaci贸n
===> Programaci贸n Basica
===> Otros Lenguajes
===> Visual Basic y Net
===> ASM
===> Programacion Shell
===> Perl
===> Carbide C/C#/C++
===> Batch
===> SQL
=> Programacion para webmasters
===> Consultas
===> Php
===> Html
===> Java - Java Script
===> Php Nuke
===> Scripts Pre-Fabricados
===> Mysql
===> CSS y Dise帽o Web
-----------------------------
Artes Graficas
-----------------------------
=> Dise帽o Grafico
===> Battle Arts
===> Flash
===> Tutoriales
===> Galer铆颅as
===> Software
-----------------------------
Area Tecnica
-----------------------------
=> Networking & Wireless
=> Overclocking, Refrigeracion y demas
=> Hardware
===> Cursos Y manuales
=> Electronica Y Robotica
-----------------------------
Programas
-----------------------------
=> Software
===> Configuraciones de software
===> Pedidos de software
=> Cracks & Serialz
=> P2p, Bittorrent, Elinks
-----------------------------
Multimedia Y Divx
-----------------------------
=> Juegos PC Y Consolas
===> Dudas ayudas y comentarios de juegos
===> Pedidos de juegos
=> Mp3
=> Multimedia
=> Peliculas Divx
-----------------------------
Entretenimiento Y sitios de interes
-----------------------------
=> Juegos, Humor y Adultos. (Diversi贸n)
===> Adultos
=> Paginas Webs Recomendadas
=> Videos
Powered by SMF 1.1.5
|
SMF © 2006-2007, Simple Machines LLC
Loading...