gpt4 book ai didi

c# - 将 ListView 中的值列表显示到电子邮件正文中

转载 作者:行者123 更新时间:2023-12-02 20:47:20 24 4
gpt4 key购买 nike

我正在尝试在电子邮件正文中显示取件号码列表。我可以使用以下代码获得取货号码:

foreach (LoadRelationship relationship in View.SelectedObjects)
{
///This works fine, I get 3 pickup numbers for my selected records///
List<string> pickUpNumbers = View.SelectedObjects.Cast<LoadRelationship>()
.Where(x => x != null && x.PurchaseLoad.PickupNumber != null)
.Select(x => x.PurchaseLoad.PickupNumber)
.ToList();
//When assigning the pickUpNumbers.To String to the body of the email it fails here:
e.Report.ExportOptions.Email.Body = pickUpNumbers.ToString();
}

电子邮件正文中的输出如下:

System.Collections.Generic.List`1[System.String]

输出应该是这样的:

12345233455612334445

最佳答案

试试这个:

e.Report.ExportOptions.Email.Body = string.Join(" ", pickUpNumbers);

关于c# - 将 ListView 中的值列表显示到电子邮件正文中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26432652/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com