开发者

C# get images from folder

开发者 https://www.devze.com 2023-04-04 07:58 出处:网络
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

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");
0

精彩评论

暂无评论...
验证码 换一张
取 消