如何从特定文件夹拍摄列表中的图像。我必须在列表中显示图像

时间:2019-05-18 13:13:19

标签: .net

我已经从文件夹中检索了图像,现在我必须使用数组将其转换为列表中的

productDTO.custom_attributes = GetCustomAttributes(row);

            Product product = new Product();
            product.product = productDTO;

            string fileName = row["image"].ToString();
            string imageName = fileName.Split('/')[1];
            if (!string.IsNullOrEmpty(fileName))
            {
                string imagefolderpath = @"" + "D:\\ItemImages";
                string fullpath = imagefolderpath + "\\" + imageName;

                byte[] imageBytes = File.ReadAllBytes(fullpath);
                string base64String = Convert.ToBase64String(imageBytes);
                string imageExt = fileName.Split('.')[1];
                if (imageExt.Equals("jpg"))
                {
                    imageExt = "jpeg";
                }

0 个答案:

没有答案