So i got this piece of code
namespace kortspel
{
public partial class Form1 : Form
{
ArrayList kortlek = new ArrayList();
Image c1 = new Bitmap("C:/Users/Mert95/Documents/Visual Studio 2012/Projects/kortspel/Spelkort/c1.png");
And i don’t want to add in 50pictures with a unique name such as Image c2 = blablabla.
Some people have said i need to create a loop, to add in these 50pictures, so is there a easier way instead of adding in 50 Images in the array?
You can use
Directory.GetFiles(string path, string searchPattern)to get an array of all the files in a directory matching a given pattern.Then, just iterate over the files in a loop like this: