FailChanel.Text = SucChannel.Text = ""; successChannel = ""; failedChannel = ""; failCount = 0; listView1.Items.Clear(); listView1.Enabled = false; string getdatafrommethod = GetDat(openFileDialog1); //check if user don't select the file //if don't select file the return value will be empty //and in the blew code will be return if (getdatafrommethod == "Empty") return; string[] yaArray = getdatafrommethod.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); progressBar1.Value = 1; progressBar1.Visible = true; progressBar1.Maximum = yaArray.Length; foreach (string item in yaArray) { //the next code for the last line in the item //when the last line is empty , continue the loop that will be finish //and when the file is empty if (item.Length == 0) continue; listViewRow = item.Split(new string[] { "," }, StringSplitOptions.None); //Now we split on the semi colon to give us each item if (!this.CheckLogin(listViewRow[1], listViewRow[0])) { failedChannel += "\r\n" + " Channel number : " + listViewRow[1] + " is failed to connect"; failCount++; continue; } successChannel += listViewRow[0] + "," + listViewRow[1] + "\r\n"; newItem = new ListViewItem(listViewRow[1]); newItem.SubItems.Add(listViewRow[0]); listView1.Items.Add(newItem); progressBar1.PerformStep(); } listView1.Enabled = true; progressBar1.Visible = false; failedChannel += "\r\n" + " Total blocked channel is : "+failCount; SucChannel.Text = "Success channel : " + listView1.Items.Count; FailChanel.Text = "Failed channel : " + failCount; savefile(ChiledBlockChnannel, true, failedChannel); savefile(ChiledSucssesChannel, true, successChannel); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)