Hi, I have an application where I have images stored in a folder called testimages and access them using :

String[] files = Directory.GetFiles(@"C:\Users\pashok\Documents\test\testimages\", "*.jpeg");

Now, I want to modify the program in such a way that the folder called testimages is placed in my project directory. In this case, how can I access the images ?

It is better to keep the image folder under the folder where your executable is available

Say for example your executable file is reside in the folder C:\Users\pashok\Documents\test u can use

String[] files = Directory.GetFiles(@"testimages\", "*.jpeg");

Hi

Try this code

Image myImg = Image.FromFile("Image path");

Thanks,
Paul dani

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.