Posted on: 9/17/2013 3:20:15 AM | Views : 611

Hi, I am using the following code to select random images from a directory and place on a web page. The directory path is passed to the function and it returns an image file name randomly. The problem is that I see the same random file is selected so often so the same image appears in the web page. How can I alter the code so in a single refresh of the page all random files are different so every image appears different on the web page. Any help would be appreciated. Thanks!
Public Function PickImageFromDirectory(ByVal dirPath As String) As String Dim dirFullPath As String = PickImageDirectory(dirPath) Dim dirInfo As New DirectoryInfo(Server.MapPath(dirFullPath)) Dim fileList() As FileInfo = dirInfo.GetFiles() Dim numberOfFiles ...

Go to the complete details ...