كود :
Imports System.IO
Public Class Form1
Dim picspath As String = "pics\"
Dim pics As New List(Of Image)
Dim pcount As Integer = 0
Private Function IsValidImage(filename As String) As Boolean
Try
Dim img As System.Drawing.Image = System.Drawing.Image.FromFile(filename)
Catch generatedExceptionName As OutOfMemoryException
' Image.FromFile throws an OutOfMemoryException
' if the file does not have a valid image format or
' GDI+ does not support the pixel format of the file.
'
Return False
End Try
Return True
End Function
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If pcount < 0 Then Exit Sub
pic.Image = pics(pcount)
pcount = Int(Rnd() * pics.Count)
Timer1.Interval = 3000
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim dir As New DirectoryInfo(picspath)
For Each fl As FileInfo In dir.GetFiles
If IsValidImage(fl.FullName) Then
pics.Add(Image.FromFile(fl.FullName))
End If
Next
End Sub
End Classاللهم إني أعوذ بك من غلبة الدين وغلبة العدو، اللهم إني أعوذ بك من جهد البلاء ومن درك الشقاء ومن سوء القضاء ومن شماتة الأعداء
اللهم اغفر لي خطيئتي وجهلي، وإسرافي في أمري وما أنت أعلم به مني، اللهم اغفر لي ما قدمت وما أخرت، وما أسررت وما أعلنت وما أنت أعلم به مني، أنت المقدم وأنت المؤخر وأنت على كل شيء قدير

