我有上传.csv文件的场景,并使用listview显示消息/状态。
以下是代码片段:
listView1.View = View.List;
listView1.Items.Add(new ListViewItem (new[]{"CUID:" + strCuID + " is refunded successfully"}));
listView1.GridLines = true;
输出:
01293821921DE成功退款//第一次 0123821921DE成功退还
01693821921DE已成功退款//最新
我希望最新的结果首先出现。我怎样才能得到预期的结果?
答案 0 :(得分:0)
OP:我希望最新的结果首先出现。我怎样才能得到预期的结果?
public static void Main()
{
List<string> ListTest = new List<string>();
ListTest.Add("01293821921DE is refunded successfully");
ListTest.Add("0123821921DE is refunded successfully");
ListTest.Add("01693821921DE is refunded successfully");
Console.WriteLine("\n List in Order \n");
foreach(var item in ListTest)
{
Console.WriteLine(item);
}
Console.WriteLine("\n List in Reverse Order \n");
for(int i = ListTest.Count() - 1; i >= 0; i--)
{
Console.WriteLine(ListTest[i]);
}
}
输出:
样本: