最近做了个程序用来专门下载图片,自己懒得在浏览器上拖拽图片,只能重复下载一个链接的图片,专业盗图的啊哈哈哈

还加了一个md5校验,用来去除重复的图片,这个是用bat做的,弄到了vb.net里面去了,方便使用

部分源码:

Public Class Form1
    Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Integer, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Integer, ByVal lpfnCB As Integer) As Long
    Public Declare Function DeleteUrlCacheEntry Lib "wininet" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
    Public x = 0
    Public url
    Public dir
    Public wen
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If Timer1.Interval < 20 Then
            TextBox4.Text = 20
            Timer1.Interval = 20
        End If
        dir = TextBox6.Text & "/"
        Shell("cmd /c md " & TextBox6.Text, AppWinStyle.Hide)
        If Timer1.Enabled = True Then
            Button2.Enabled = True
            TextBox1.Enabled = True
            TextBox2.Enabled = True
            TextBox3.Enabled = True
            TextBox4.Enabled = True
            TextBox5.Enabled = True
            TextBox6.Enabled = True
            TextBox7.Enabled = True
            Timer1.Enabled = False
            Button1.Text = "关"
        ElseIf Timer1.Enabled = False Then
            Button2.Enabled = False
            TextBox1.Enabled = False
            TextBox2.Enabled = False
            TextBox3.Enabled = False
            TextBox4.Enabled = False
            TextBox5.Enabled = False
            TextBox6.Enabled = False
            TextBox7.Enabled = False
            Timer1.Enabled = True
            Button1.Text = "开"
        End If

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        If TextBox7.Text <> "" Then
            TextBox7.Text += 1
            wen = "?" & TextBox7.Text
        End If
        If TextBox7.Text = "" Then
            wen = ""
        End If
        Timer1.Interval = TextBox4.Text
        url = TextBox1.Text
        x += 1
        Call URLDownloadToFile(0, url & wen, dir & TextBox2.Text & x & TextBox5.Text & TextBox3.Text, 0, 0)
        Label1.Text += 1
        If CheckBox1.Checked = True Then
            DeleteUrlCacheEntry(url)
        End If
        If Label1.Text = TextBox8.Text Then
            Button2.Enabled = True
            TextBox1.Enabled = True
            TextBox2.Enabled = True
            TextBox3.Enabled = True
            TextBox4.Enabled = True
            TextBox5.Enabled = True
            TextBox6.Enabled = True
            TextBox7.Enabled = True
            Timer1.Enabled = False
            Button1.Text = "关"
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Label1.Text = 0
        x = 0
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Form2.Show()
    End Sub

    Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
        If Me.Size.Height <> 340 Or Me.Size.Width <> 596 Then
            Me.Size = New Size(596, 340)
        End If
    End Sub
End Class

愿天下所有人都变成少女~