我想从我的电脑文件夹中随机显示一张图片,但每张图片只能显示一次!
这可能吗?
这是我设法找到的:
Dim rnd As New Random
Dim alljpgs() As String = IO.Directory.GetFiles("C:\ImageFolder", "*.*", IO.SearchOption.TopDirectoryOnly)
Dim jpg As New Bitmap(alljpgs(rnd.Next(0, alljpgs.Count - 1)))
PictureBox1.BackgroundImage = jpg
提前致谢!