private void lbText_DoubleClick(object sender, EventArgs e) { if (isFolder == 1) { if (isRemote == 0) { F.HereLastPath = F.HerePath; F.HerePath = PATH; F.REFRESH1(); } else { DHuy.AddCommand_Trans(F.SESSION_TRANS_ID, "FILE_TRANSFER_OPEN;" + F.SESSION_TRANS_ID + ";" + PATH); } } else { try { System.Diagnostics.Process.Start(PATH); } catch (Exception ex) { } } }
private void bgw_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { isbusy = 1; try { if (isSend == 1) { byte[] file_data = System.IO.File.ReadAllBytes(Here_File); dt.Rows[0]["FILE_DATA"] = file_data; kq = DHuy.UPDATE("FILE_TRANSFER", dt, "ID", "FILE_DATA"); dt.Rows[0]["SEND_STATUS"] = 1; kq = DHuy.UPDATE("FILE_TRANSFER", dt, "ID", "SEND_STATUS"); DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_RECEIVE;" + Remote_File + ";" + Here_FileName); } else { if (Here_File == "Home") { Here_File = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); } DHuy.DownloadFile("FILE_TRANSFER", "FILE_DATA", "ID", SESSION_TRANS_ID, Here_File + "\\" + Path.GetFileName(Remote_File)); } } catch (Exception ex) { } }
private void FileExplorer_Load(object sender, EventArgs e) { try { kq = DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_INIT;" + SESSION_TRANS_ID); HOME1_Click(null, null); timer1.Start(); this.Text = "Session : " + SESSION_TRANS_ID + " - " + CONTROL_ID + " --> " + REMOTE_ID; } catch (Exception ex) { } }
private void FileTransfer_Process_Load(object sender, EventArgs e) { try { if (isSend == 1) { Finfo = new FileInfo(Here_File); this.Text = Finfo.FullName; Here_FileName = Finfo.Name; edtFileName.Text = (Here_FileName.Length > 23 ? Here_FileName.Substring(0, 20) + "..." : Here_FileName) + " ( 50Kb/s )"; progressBar1.Maximum = (int)Finfo.Length; timer1.Start(); W1.RunWorkerAsync(); } else if (isSend == 0) // Send command to remote for upload { string Remote_FileName = Path.GetFileName(Remote_File); edtFileName.Text = (Remote_FileName.Length > 23 ? Remote_FileName.Substring(0, 20) + "..." : Remote_FileName) + " ( 50Kb/s )"; DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_UPLOAD;" + SESSION_TRANS_ID + ";" + Remote_File); timer1.Start(); } } catch (Exception ex) { } }
private void UP2_Click(object sender, EventArgs e) { DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_FOLDER_UP;" + SESSION_TRANS_ID + ";" + RemotePath); }
private void HOME2_Click(object sender, EventArgs e) { DHuy.AddCommand_Trans(SESSION_TRANS_ID, "FILE_TRANSFER_INIT;" + SESSION_TRANS_ID); }