//SEND/RECEIVE private void SEND(object sender, EventArgs e) { DataTable dt = DHuy.SELECT_SQL("SELECT * FROM FILE_TRANSFER WHERE ID = " + SESSION_TRANS_ID); if (DBase.IsFolder(HerePath) == 1) { return; } if (dt.Rows.Count > 0) { FileTransfer_Process P = new FileTransfer_Process(); P.isSend = 1; P.dt = dt; P.Here_File = HerePath; P.Remote_File = RemotePath; P.SESSION_TRANS_ID = SESSION_TRANS_ID; P.F = this; P.Location = new Point(Location.X + (Width - P.Width) / 2, Location.Y + (Height - P.Height) / 2); P.Show(); } else { Confirm C = new Confirm(); C.SetColor(Color.LightCoral); C.edtText.Text = "Session is expired ! ... Close ? "; C.StartPosition = FormStartPosition.Manual; C.Location = new Point(Location.X + (Width - C.Width) / 2, Location.Y + (Height - C.Height) / 2); C.ShowDialog(this); if (C.Res == 1) { this.Close(); } } }
public FileTransfer(int CID, int RID, string FilePath) { InitializeComponent(); try { DataTable dti = DHuy.SELECT_NEWROW("FILE_TRANSFER"); String key = DBase.biDateTimeSave(DateTime.Now); dti.Rows[0]["ID"] = 0; dti.Rows[0]["DATA"] = new byte[3]; dti.Rows[0]["FILE_DATA"] = new byte[3]; dti.Rows[0]["CONTROL_ID"] = CID; dti.Rows[0]["REMOTE_ID"] = RID; dti.Rows[0]["MD5"] = key; kq = DHuy.INSERT_IDENTITY_UID("FILE_TRANSFER", dti); DataTable temp = DHuy.SELECT_SQL("SELECT * FROM FILE_TRANSFER WHERE MD5 = '" + key + "'"); SESSION_TRANS_ID = DBase.IntReturn(temp.Rows[0]["ID"]); REMOTE_ID = RID; CONTROL_ID = CID; FileTransfer_Process P = new FileTransfer_Process(); P.isSend = 1; P.dt = temp; P.Here_File = FilePath; P.Remote_File = "Home"; P.SESSION_TRANS_ID = SESSION_TRANS_ID; P.F = this; P.StartPosition = FormStartPosition.CenterParent; P.Show(this); //this.Close(); } catch (Exception ex) { } }