Public Class Form1
Dim s As String
Dim strname(1000000) As String
Dim j As Integer = 0
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
s = Dir("H:\图\fate\*.jpg")
Dim i As Integer
Do While s <> ""
strname(i) = "H:\图\fate\" & s
s = Dir()
i = i + 1
Loop
If Dir(strname(j)) <> "" Then
Me.PictureBox1.ImageLocation = strname(j)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
j = j + 1
If Dir(strname(j)) <> "" Then
Me.PictureBox1.ImageLocation = strname(j)
End If
End Sub
End Class