private void Temp_CompressMsg(UpLoadMsg msg) { switch (msg.Status) { case "压缩完成": var fs = File.OpenRead(msg.FileName); string ext = Path.GetExtension(msg.FileName); string fileName = Path.GetFileName(msg.FileName); this.Invoke((MethodInvoker) delegate() { listView1.Items[msg.Id].SubItems[3].Text = msg.Status; Application.DoEvents(); }); //System.Net.ServicePointManager.DefaultConnectionLimit = 50; System.GC.Collect(); lanZhouHelper.AddUpLoad(fs, fileName, ext, msg.Id, listView1); break; case "上传成功": this.Invoke(new MethodInvoker(() => { listView1.Items[msg.Id].SubItems[0].Text = msg.FileName; listView1.Items[msg.Id].SubItems[1].Text = msg.ShareAddress; listView1.Items[msg.Id].SubItems[2].Text = msg.Pwd; listView1.Items[msg.Id].SubItems[3].Text = msg.Status; })); break; default: break; } }
private void LanZhouHelper_loadSendMsg(UpLoadMsg msg) { this.Invoke(new MethodInvoker(() => { this.Invoke((MethodInvoker) delegate() { listView1.Items[msg.Id].SubItems[0].Text = msg.FileName; listView1.Items[msg.Id].SubItems[1].Text = msg.ShareAddress; listView1.Items[msg.Id].SubItems[2].Text = msg.Pwd; listView1.Items[msg.Id].SubItems[3].Text = msg.Status; Application.DoEvents(); }); })); }