Help con Descarga

Iniciado por blood_brother, 24 Marzo 2010, 06:22 AM

0 Miembros y 1 Visitante están viendo este tema.

blood_brother

Holas  amigos  a ver si me pueden ayudar  quiero  ver si se puede hacer que  decargue  una lista de  archivos desde  un  .ini o cfg, estoy usando un progressbar. pero no logro  hacer que me  funcione  y que me descargen a ver  si me pueden ayudar por favor

BlackZeroX

.
te quedaste seco con tu descripcion.
.
The Dark Shadow is my passion.

blood_brother

A ver si me  explico mejor tengo un archivo  llamado  Updates.ini o  Updates.cfg

[Updates]

\ATL80.dll
\CompressATI.dll
\CompressATI2.dll
\Cry3DEngine.dll
\CryAnimation.dll
\CryEntitySystem.dll
\CryFont.dll
\CryInput.dll
\CryMovie.dll
\CryPhysics.dll
\CryScriptSystem.dll
\CrySoundSystem.dll
\DataServer.exe
\IpFixModule.dll
\LICENSES.txt
\Microsoft.VC80.ATL.manifest 
\Microsoft.VC80.CRT.manifest   
\Microsoft.VC80.MFC.manifest
\ScriptDLL.dll
\SendLogClient.exe
\TextEngine.dll
\XRenderD3D9.dll
\aion.bin
\beecrypt.dll
\binkw32.dll
\config.ini
\crysystem.dll
\d3dx9_38.dll
\dbghelp.dll
\fmodex.dll
\game.dll 
\ijl15.dll 
\libeay32.dll
\mfc80.dll 
\mfc80u.dll 
\mfcm80.dll
\mfcm80u.dll
\msvcm80.dll
\msvcp80.dll 
\msvcr71.dll
\msvcr80.dll 
\srcsrv.dll
\ssleay32.dll 
\symsrv.dll


Ahora todos esos a rchivos los tengo en internet. estuve  buscando en google y aqui en  este foro consegui este  codigo pero  resulta que me descarga  1  solo archivo .

Private Sub Entrar_Click()
Download.Value = 0
Inet1.AccessType = icUseDefault
Inet1.URL = "http://miweb.com/Updates/bin32/"
Inet1.Execute , "GET" 'Indicamos que vamos a descargar o recuperar un _
archivo desde una url

End Sub


Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant 'acá almacenamos los datos

Select Case State

Case icResponseCompleted
Dim bDone As Boolean: bDone = False
Dim tempArray() As Byte ' Un array para grabar los datos en un archivo
'Para saber el tamaño del fichero en bytes
filesize = Inet1.GetHeader("Content-length")
'Establecemos el Max del = a al tamaño del archivo
Download.Max = filesize
contenttype = Inet1.GetHeader("Content-type")
'Creamos y abrimos un nuevo archivo en modo binario
Open App.Path + "\ATL80.dll" For Binary Access Write As #1
Open App.Path + "\CompressATI.dll" For Binary Access Write As #1
Open App.Path + "\CompressATI2.dll" For Binary Access Write As #1
Open App.Path + "\Cry3DEngine.dll" For Binary Access Write As #1
Open App.Path + "\CryAnimation.dll" For Binary Access Write As #1
Open App.Path + "\CryEntitySystem.dll" For Binary Access Write As #1
Open App.Path + "\CryFont.dll" For Binary Access Write As #1
Open App.Path + "\CryInput.dll" For Binary Access Write As #1
Open App.Path + "\CryMovie.dll" For Binary Access Write As #1
Open App.Path + "\CryPhysics.dll" For Binary Access Write As #1
Open App.Path + "\CryScriptSystem.dll" For Binary Access Write As #1
Open App.Path + "\CrySoundSystem.dll" For Binary Access Write As #1
Open App.Path + "\DataServer.exe" For Binary Access Write As #1
Open App.Path + "\IpFixModule.dll" For Binary Access Write As #1
Open App.Path + "\LICENSES.txt" For Binary Access Write As #1
Open App.Path + "\Microsoft.VC80.ATL.manifest" For Binary Access Write As #1
Open App.Path + "\Microsoft.VC80.CRT.manifest" For Binary Access Write As #1
Open App.Path + "\Microsoft.VC80.MFC.manifest" For Binary Access Write As #1
Open App.Path + "\ScriptDLL.dll" For Binary Access Write As #1
Open App.Path + "\SendLogClient.exe" For Binary Access Write As #1
Open App.Path + "\TextEngine.dll" For Binary Access Write As #1
Open App.Path + "\XRenderD3D9.dll" For Binary Access Write As #1
Open App.Path + "\aion.bin" For Binary Access Write As #1
Open App.Path + "\beecrypt.dll" For Binary Access Write As #1
Open App.Path + "\binkw32.dll" For Binary Access Write As #1
Open App.Path + "\config.ini" For Binary Access Write As #1
Open App.Path + "\crysystem.dll" For Binary Access Write As #1
Open App.Path + "\d3dx9_38.dll" For Binary Access Write As #1
Open App.Path + "\dbghelp.dll" For Binary Access Write As #1
Open App.Path + "\fmodex.dll" For Binary Access Write As #1
Open App.Path + "\game.dll" For Binary Access Write As #1
Open App.Path + "\ijl15.dll" For Binary Access Write As #1
Open App.Path + "\dbghelp.dll" For Binary Access Write As #1
Open App.Path + "\libeay32.dll" For Binary Access Write As #1
Open App.Path + "\mfc80.dll" For Binary Access Write As #1
Open App.Path + "\mfc80u.dll" For Binary Access Write As #1
Open App.Path + "\mfcm80.dll" For Binary Access Write As #1
Open App.Path + "\mfcm80u.dll" For Binary Access Write As #1
Open App.Path + "\msvcm80.dll" For Binary Access Write As #1
Open App.Path + "\msvcp80.dll" For Binary Access Write As #1
Open App.Path + "\msvcr71.dll" For Binary Access Write As #1
Open App.Path + "\msvcr80.dll" For Binary Access Write As #1
Open App.Path + "\srcsrv.dll" For Binary Access Write As #1
Open App.Path + "\ssleay32.dll" For Binary Access Write As #1
Open App.Path + "\symsrv.dll" For Binary Access Write As #1
' Leemos de a 1 Kbytes. El segundo parámetro indica _
el tipo de fichero. Tipo texto o tipo Binario, en este caso _
binario
vtData = Inet1.GetChunk(1024, icByteArray)

DoEvents
'Si el tamaño del fichero es 0 ponemos bDone en True para que no _
entre en el bucle
If Len(vtData) = 0 Then
bDone = True
End If

Do While Not bDone
'Almacenamos en un array el contenido del archivo
tempArray = vtData
'Escribimos el archivo en disco
Put #1, , tempArray
'Aumentamos la barra
Download.Value = Download.Value + Len(vtData) * 2
' Leemos de pedazos de a 1 kb (1024 bytes)
vtData = Inet1.GetChunk(1024, icByteArray)
DoEvents

If Len(vtData) = 0 Then
bDone = True
End If
Loop

Close #1
Download.Value = 0

End Select
End Sub


Espero que me puedan ayudar

seba123neo

tenes que leer el archivo linea por linea descargar el archivo que vas leyendo...nada mas...

saludos.
La característica extraordinaria de las leyes de la física es que se aplican en todos lados, sea que tú elijas o no creer en ellas. Lo bueno de las ciencias es que siempre tienen la verdad, quieras creerla o no.

Neil deGrasse Tyson

blood_brother

me puedes  decir  un ejemplo mas o menos  amigo por favor

BlackZeroX


Código (vb) [Seleccionar]


Public Function GetLinesFile(StrFile As String, outCantLineas As Long) As String()
Dim ff#
Dim NLines%
Dim Lineas$()

    ff = FreeFile
    Open StrFile For Binary Access Read As ff
        ReDim Lineas$(0 To 100)
        Do
            If NLines% > UBound(Lineas$) Then ReDim Preserve Lineas$(0 To UBound(Lineas$) + 101)
            Line Input #ff, Lineas(NLines%)
            NLines% = NLines% + 1
        Loop While Not EOF(ff)
        ReDim Preserve Lineas$(0 To NLines% - 1)
    Close ff
    outCantLineas = NLines%
    GetLinesFile = Lineas$()
End Function

Sub main()
Dim Linea$()
Dim CantidadLineas                          As Long
Const StrFile                               As String = "c:\descargas.txt"

    Linea = GetLinesFile(StrFile, CantidadLineas)
    MsgBox "Hay un total de " & CantidadLineas & " Lineas en el archivo: " & vbCrLf & StrFile
    For Index = LBound(Linea) To UBound(Linea)
        Debug.Print Linea(Index)
    Next
   
End Sub



Para descargar un archivo no uses el Inet aqui tiene una alternativa:


http://infrangelux.sytes.net/index.php?option=com_content&task=view&id=92&Itemid=87


Mas info de manejo de los archivos:



http://www.recursosvisualbasic.com.ar/htm/tutoriales/tutorial-basico7.htm



Sangriento Infierno Lunar!¡.
The Dark Shadow is my passion.