我正在使用 do-while 循环来获取列表框的每个项目。
我的代码示例如下:
do
{
string nameOfPersonFromWeb;
//Here is code that do some task from web
//for eg. get the name list from the website...
ListBox.Items.Add(nameOfPersonFromWeb);
totalnumber++;
} while (totalNumber<=25);
我的问题是,我没有立即得到每件物品。当循环结束时,它正在显示整个项目。
我想在列表框中的每个循环中显示名称。我还想通过发送列表框项的索引来突出显示特定的列表框项。我在代码后面和 Asp.net 中使用 C#。