private void SetText(NET.Message mes) { if (this.listView1.InvokeRequired) { MyInvoke _myInvoke = new MyInvoke(SetText); this.Invoke(_myInvoke, new object[] { mes }); } else { NET.Message m = mes as NET.Message; ListViewItem[] lvi = new ListViewItem[m.Result.Count]; NET.FileInfo fi; for (int i = 0; i < m.Result.Count; i++) { fi = m.Result[i]; lvi[i] = new ListViewItem(new string[] { fi.fileName, fi.IP, fi.Path, fi.introduction }); } this.listView1.Items.AddRange(lvi); } }
private void show(NET.Message mes) { SetText(mes); }