①确保listbox中存储的文本名称,包括其所在完整路径
②在listbox的SelectedIndexChanged事件中,添加代码:
string[] contents=System.IO.File.ReadAllLines(@listbox.selectedItem);
foreach(string temp in contents)
{
textbox.appendText(temp);
}
textbox1.text = listbox,selectItem.tostring();
textbox1.text += "," + listbox,selectItem.tostring();
textbox1.text = textbox1.text.SubString(1);