C# 如何基于整数从列表框中获取特定行
我这里有一个非常基本的列表框,我想根据listbox1.items.count从特定行获取文本;因为这是一个整数 如何获取对应于该整数的行(本质上是行号),并将该行存储到字符串RecentPlayer中C# 如何基于整数从列表框中获取特定行,c#,string,listbox,integer,int,C#,String,Listbox,Integer,Int,我这里有一个非常基本的列表框,我想根据listbox1.items.count从特定行获取文本;因为这是一个整数 如何获取对应于该整数的行(本质上是行号),并将该行存储到字符串RecentPlayer中 Ex. Line # ListBox Contents Line 0 Some String Line 1 Some Other Line 3 Something Else 请提供填充Listbox的代码它非常长……但这里只有一行playerList.I
Ex.
Line # ListBox Contents
Line 0 Some String
Line 1 Some Other
Line 3 Something Else
请提供填充Listbox的代码它非常长……但这里只有一行
playerList.Items.Add(player.Info.Rank.Name+“-”+player.Name)代码>我刚刚想出了如何在更新ToString()选项时正确使用它:P
string value = playerList.Items[index].ToString();