private void UpLoad_Load(object sender, EventArgs e) { if (listViewItemCollection == null || listViewItemCollection.Count == 0) { MessageBox.Show("请先启动程序,或手动加载压缩文件"); this.Close(); return; } if (LanZhouHelper.cookieContainer.Count == 1) { MessageBox.Show("请先录入蓝奏云用户名或密码"); this.Close(); return; } ///创建临时文件并上传 Temp temp = new Temp(); temp.CompressMsg += Temp_CompressMsg; int i = 0; foreach (ListViewItem item in listViewItemCollection) { var address = item.SubItems[8].Text; listView1.Items.Add(new ListViewItem(new string[] { address, "", "", "" })); temp.AddTask(address, i); i++; } //启动线程 temp.RunTask(); }