我是 C# 新手,我到处搜索,没有找到任何解决方案。
private void kryptonButton5_Click(object sender, EventArgs e)
{
adapters();
MessageBox.Show(listBox1.Text);//How to get selected card name only ?
}
private void adapters()
{
foreach (NetworkInterface net_card in NetworkInterface.GetAllNetworkInterfaces())
{
listBox1.Items.Add(net_card.Name + " " + net_card.Description + " " + net_card.Id);
}
}
我怎样才能只获得选定的卡名?