C# get images from folder
I have a product with this code: 1945开发者_开发问答78
There is a folder with a lot of images, the product's main image is 194578.JPG
There are some other images for the same product that I have to show as details but the thing is, these other images I have no idea of how much I only know they have a letter after the numbers, like:
194578A.jpg
194578B.jpg
194578C.jpg
and so on, until the max o 194578Z.jpg
I have the product code, how do I get those detail images?
Thanks in advance for any help.
You can use Directory.GetFiles
to find files in a directory matching a pattern:
var files = Directory.GetFiles("path/to/directory", prefix + "?.jpg");
精彩评论