void conn_OnReceive(object sender, SocketClient.Handler.CommReceiveEventArgs e) { if (e.MethodId == "Getlogs") { List <SocketClient.Model.oplog> mlist = (List <SocketClient.Model.oplog>)e.ObjData; this.Invoke(new MethodInvoker(delegate() { this.dataGridView1.DataSource = mlist; })); } }
void conn_OnReceive(object sender, SocketClient.Handler.CommReceiveEventArgs e) { //throw new NotImplementedException(); if (e.MethodId == "GetFile") { SocketClient.Model.FileModel model = SocketClient.Command.CommAnalysis.getFileModel(e.Message); string FilePath = Path.Combine(fullPath, model.FileName); FileStream MyFileStream = new FileStream(FilePath, FileMode.Create, FileAccess.Write); MyFileStream.Write(model.FileByte, 0, model.FileByte.Length); MyFileStream.Close(); if (CurrentFileName == model.FileName) { autoResetEvent.Set(); } } }