The problem is that you are comparing
ListViewItem
objects which, even if they may have the same text, are distinct objects. Thus, your comparison does not achieve what you expect it to.
You could try
using System.Linq;
if (!listView1.Items.Any(i => i.Text == epc)) {
listView1.Items.Add(new ListViewItem(epc));
}
Edit: solution without Linq
Without Linq, you have to resort to old-fashioned iteration over the collection:
bool found = false;
foreach (ListViewItem item in listView1.Items) {
if (item.Text == epc) {
found = true;
break;
}
}
if (!found) {
listView1.Items.Add(new ListViewItem(epc));
}