I was trying to pull 4 different images from thispersondoesnotexist.com, but it ends up getting duplicate images occassionally. Setting a delay seems to have lowered a chance of this happening, but to eliminate the problem the program would become very slow due to the delays. Can someone come up with a better solution? This is my current code: (the parameters are so it wont get cashed)
private void btnStart_Click(object sender, EventArgs e) { btnStart.Visible = false; var random = new Random(); var randomnumber = random.Next(10, 30); pbPerson1.Load(""); System.Threading.Thread.Sleep(500); pbPerson2.Load(""); System.Threading.Thread.Sleep(500); pbPerson3.Load(""); System.Threading.Thread.Sleep(500); pbPerson4.Load(""); } 31 Answer
The site works by randomly generating images on a timer... it takes time to generate the images, it is not intended to retrieve a unique image for every request.
At any rate, this is not related to your code, and is a question that your should direct to the developer of the site (their contact details are on the main page: )