private void AddBtn_Click(object sender, EventArgs e) { string[] listviewData = new string[2]; this.LoadListView( ); addFlag = false; VideoFileInfo videoFileInfo = new VideoFileInfo(Const.videoName); videoFileInfo.setPath(Const.videoPath); for (int j = 0; j < Const.fileArrayList.Count; j++) { if (((VideoFileInfo)Const.fileArrayList[j]).getName().Equals(videoFileInfo.getName())) { addFlag = true; } } if (!addFlag) { Const.fileArrayList.Add(videoFileInfo); } ListViewItem[] lvItem = new ListViewItem[Const.fileArrayList.Count]; for (int i = 0; i < Const.fileArrayList.Count; i++) { listviewData[0] = ((VideoFileInfo)Const.fileArrayList[i]).getName(); listviewData[1] = ((VideoFileInfo)Const.fileArrayList[i]).getPath(); lvItem[i] = new ListViewItem(listviewData, i); listView1.Items.Add(lvItem[i]); } }