我已经从文件夹中检索了图像,现在我必须使用数组将其转换为列表中的
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";
}