新增和查询数据 都是基于txt
private void LoadData(string kind)
{
listView.Items.Clear();
StreamReader streamReader = new StreamReader("Recorder.txt");
try
{
while (!streamReader.EndOfStream)
{
string nstr = streamReader.ReadLine();
string kstr = streamReader.ReadLine();
if((kind == "所有") || (kind == kstr))
{
ListViewItem item = listView.Items.Add(nstr);
item.SubItems.Add(kstr);
item.SubItems.Add(streamReader.ReadLine());
item.SubItems.Add(streamReader.ReadLine());
item.SubItems.Add(streamReader.ReadLine());
}
else
{
streamReader.ReadLine();
streamReader.ReadLine();
streamReader.ReadLine();
}
}
}
catch (Exception ex)
{
//
}
finally
{
streamReader.Close();
}
}
评论