Dim th As New System.Threading.Thread (AddressOf download) Sub reload () Dim url As New System.Net.WebClient Dim b () As Byte = url.DownloadData (TextBox1.Text) Dim s As String = System.Text. Encoding.default.getstring (b) TextBox4.text = s Dim Base as string = textBox1.text base = base.substring (0, base.lastIndexof ("/") 1) DIM SS1 () AS String = Split (TextBox2 .Text, "") DIM I, J AS INTEGER for i = 0 to ss1.length - 1 DIM SS () AS String = GetSRC (S, SS1 (I), Base) for J = 0 to ss.length - 1 CheckedListBox1.Items.Add (ss (j), True) Next Next End Sub Private Sub TextBox1_KeyPress (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If e.KeyChar = Chr (13) THEN RELOAD () endsrc (byval s as string, byval hz as string) AS String () DIM SS () AS STRI Ng = Split (S, Hz) DIM SSS (SS.LENGTH - 2) AS STRING DIM I, J AS INTEGER for i = 0 to ss.length - 2 J = SS (i) .lastIndexof ("") IF j < 0 THEN J = 0 DIM SRC AS STRING = SS (I) .substring (J, SS (i) .length - j) & Hz J = Src.Indexof ("http: //") Dim b as string = "" IF j <= 0 THEN J = Src.lastIndexof ("=") 1 b = base end if if j <= 0 THEN J = Src.lastIndexof (") 2 b =
Base end if src = b & src.substring (j) SRC = src.replace ("'", "") SRC = src.replace (chr (34), "") SSS (i) = src Next Return sss End FunctionPrivate Sub TextBox2_KeyPress (ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox2.KeyPress If e.KeyChar = Chr (13) Then reload () End If End Sub
Private Sub Button1_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Button1.Text = "Download" Then th.Start () Button1.Text = "Stop" Else Timer1.Enabled = True Button1 .Enabled = false button1.text = "waiting ..." th.abort () end if end sub sub Download () ing checkdlistbox1.items.count = 0 Then reload () end if Dim Url as new system.net.WebClient Dim i As Integer For i = 0 To CheckedListBox1.Items.Count - 1 If CheckedListBox1.GetItemCheckState (i) = CheckState.Checked Then Dim s As String = CheckedListBox1.Items.Item (i) Dim f As String = System.IO. Path.GetFileName (s) try me.text = s Url.downloadfile (s, TextBox3.text & "/" & f) CheckedListBox1.SetItemCheckState (i, checkstate.unchecked) CA TCH EX AS Exception TextBox4.text & = EX.TOSTRING & VBNEWLINE END TRY END IF
Next end SUB