Autor
|
Tema: Resource Downloader (Leído 3,076 veces)
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.821
|
No estoy delante de la IDE, si hay algun error de sintaxis corrígelo: ' dim strarray() as string = io.file.readalllines("C:\ids.txt") for each ID as string in io. file. readalllines("C:\ids.txt"): downloader (ID ) : next private sub downloader(byval ID as string) ' descargar ID dim url = nothing try : url = new uri(ID) : catch : msgbox("Enlace no válido"): end try ... end sub
|
|
« Última modificación: 22 Julio 2013, 23:57 pm por EleKtro H@cker »
|
En línea
|
|
|
|
SγиtαxEяяoя
Desconectado
Mensajes: 154
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim client As WebClient = New WebClient AddHandler client.DownloadProgressChanged, AddressOf client_ProgressChanged AddHandler client.DownloadFileCompleted, AddressOf client_DownloadCompleted client.DownloadFileAsync(New Uri("http://d1hmtg1vead5c8.cloudfront.net/sr/images/ships/swf_big_1.5.4/" & ListView1.SelectedItems(0).Text & ".swf"), (".\Archivos\") & ListView1.SelectedItems(0).Text & ".swf") Button1.Text = "Please Wait" Button1.Enabled = False 'If ListView1.SelectedItems.Count > 0 Then ' My.Computer.Network.DownloadFile("http://d1hmtg1vead5c8.cloudfront.net/sr/images/ships/swf_big_1.5.4/" & ListView1.SelectedItems(0).Text & ".swf", (".\Archivos\") & ListView1.SelectedItems(0).Text & ".swf") 'End If End Sub Private Sub client_ProgressChanged(ByVal sender As Object, ByVal e As DownloadProgressChangedEventArgs) Dim bytesIn As Double = Double.Parse(e.BytesReceived.ToString()) Dim totalBytes As Double = Double.Parse(e.TotalBytesToReceive.ToString()) Dim percentage As Double = bytesIn / totalBytes * 100 progressBar1.Value = Int32.Parse(Math.Truncate(percentage).ToString()) End Sub Private Sub client_DownloadCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Button1.Text = "Start Download" Button1.Enabled = True ProgressBar1.Value = 0 End Sub
Esto es algo de lo que llevo, como puedo integrar tu codigo con el mio.. es decir como puedo hacer que al presionar el "Button1" se descargue todo lo que hay en el "Listview1"
|
|
|
En línea
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
Sencillo: For Each ID In ListBox1.Items My.Computer.Network.DownloadFile(ID, ".\Archivos\" & ListView1.SelectedItems(0).Text & ".swf") Next
No estoy seguro si va a funcionar, pero la idea seria algo así.
|
|
« Última modificación: 23 Julio 2013, 01:02 am por Ikillnukes »
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.821
|
Haces un ciclo en la colección de items del Listbox, y listo, como te ha comentado IkillNukes.
Saludos
|
|
|
En línea
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
Bieeeen, como me gusta no equivocarme cuando ayudo! :3 PD: Muy fuera del tema: Donde tás metio tol día Elektro? PDS: Espero que se hayan arreglado tus dudas Syntax, ya sabes si tienes alguna duda más, pues posteala...
|
|
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
|
z3nth10n
Desconectado
Mensajes: 1.583
"Jack of all trades, master of none." - Zenthion
|
Descarga el code de fuente y usa regex para borrar lo que no quieras del archivo.
|
|
|
En línea
|
⏩ Interesados hablad por Discord.
|
|
|
Eleкtro
Ex-Staff
Desconectado
Mensajes: 9.821
|
Puedes parsear un documento JSON usando > JSON.NET < O puedes loopear todas las lineas del documento y filtrar usando > RegEx < Dim json As String = <a><![CDATA["1010204": {]]></a>.Value Dim [RegEx] As New System.Text.RegularExpressions.Regex(<a><![CDATA[\"(\d{7})\"]]></a>.Value) MsgBox([RegEx].Match(json).Groups(1).ToString)
EDITO: Dim JSON As String = IO. File. ReadAllText("File.json") Dim Pattern As String = <a><![CDATA[\"(\d{7,7})\"]]></a>.Value Dim Matches As Match = Regex.Match(JSON, Pattern) Do While Matches.Success MsgBox(Matches.Groups(1).ToString) Matches = Matches.NextMatch() Loop
Saludos.
|
|
« Última modificación: 23 Julio 2013, 02:25 am por EleKtro H@cker »
|
En línea
|
|
|
|
|
|