public void MessageNotify(string msg) { FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = msg; m_ftpcom.OnMessage(e); }
public void CommandNotify(string msg) { FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = msg.Substring(0, msg.Length - 2); m_ftpcom.OnFTPCommand(e); }
public void LoginCompleted() { FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = ""; m_ftpcom.OnLogged(e); }
public void TransferCompleted(int BytesTransfered, int TimeElapsed) { string s; s = m_dataSock.Response; m_dataSock.Disconnect(); FTPEventArgs e = new FTPCom.FTPEventArgs(); e.TotalBytes = BytesTransfered; e.TimeElapsed = TimeElapsed; e.Message = s; if (m_dataSock.DataCommande == 0) { m_ftpcom.OnDirCompleted(e); } else if (m_dataSock.DataCommande == 1) { m_ftpcom.OnFileDownloadCompleted(e); } else { m_ftpcom.OnFileUploadCompleted(e); } m_dataSock = null; }
private void ftpc_FileUploadCompleted(object sender, FTPCom.FTPEventArgs e) { string msg = "Transfered " + e.TotalBytes.ToString() + " bytes in " + ((float)e.TimeElapsed / 1000).ToString() + " seconds" + CRLF; TextLog.SelectionColor = Color.Black; TextLog.AppendText(msg); ftpc.Dir(); }
public void LoginFailure() { CancelCommand(); FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = ""; m_ftpcom.OnLoginFailure(e); }
public void PourcentDownload(int bytestransfered, int totalbytes) { string msg = bytestransfered.ToString() + CRLF; FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = msg; m_ftpcom.OnMessage(e); }
private void ftpc_Message(object sender, FTPCom.FTPEventArgs e) { TextLog.SelectionColor = Color.Green; if (e.Message != string.Empty) { TextLog.AppendText(e.Message); } TextLog.AppendText(Environment.NewLine); }
public void ConnectionCompleted() { FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = ""; m_ftpcom.OnConnected(e); // The connection is succeeded m_bConnected = true; ProceedNextCommand(); }
public void ErrorNotify(string msg, string functionName) { CancelCommand(); FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = msg; e.FunctionName = functionName; m_ftpcom.OnError(e); }
private void ftpc_Error(object sender, FTPCom.FTPEventArgs e) { TextLog.SelectionColor = Color.Red; TextLog.AppendText(e.FunctionName); TextLog.AppendText("-"); if (e.Message != string.Empty) { TextLog.AppendText(e.Message); } }
private void ftpc_FTPCommand(object sender, FTPCom.FTPEventArgs e) { TextLog.SelectionColor = Color.Blue; if (e.Message != string.Empty) { TextLog.AppendText(e.Message); } TextLog.AppendText("\n"); TextLog.SelectionStart = TextLog.TextLength; TextLog.ScrollToCaret(); }
private void ftpc_DirCompleted(object sender, FTPCom.FTPEventArgs e) { int i = 0; int idimage = 0; string msg; msg = "Transfered " + e.TotalBytes.ToString() + " bytes in " + ((float)e.TimeElapsed / 1000).ToString() + " seconds" + CRLF; TextLog.SelectionColor = Color.Black; TextLog.AppendText(msg); ServerView.BeginUpdate(); ServerView.Items.Clear(); ImgListServerSmall.Images.Clear(); ListViewItem lvItem = new ListViewItem(".."); ServerView.Items.Add(lvItem); for (i = 0; i < ftpc.FileCount; i++) { if (ftpc.IsFolder(i)) { string[] items = new String[2]; items[0] = ftpc.GetFileName(i); items[1] = ftpc.GetFileSize(i).ToString(); ImgListServerSmall.Images.Add(m_IconFolder); ServerView.Items.Add(new ListViewItem(items, idimage++)); } } for (i = 0; i < ftpc.FileCount; i++) { if (!ftpc.IsFolder(i)) { string[] items = new String[2]; items[0] = ftpc.GetFileName(i); items[1] = ftpc.GetFileSize(i).ToString(); ImgListServerSmall.Images.Add(ExtractIcon.GetIcon(items[0], false)); ServerView.Items.Add(new ListViewItem(items, idimage++)); } } ServerView.EndUpdate(); this.Cursor = Cursors.Default; }
public void CommandNotify(string msg) { FTPEventArgs e = new FTPCom.FTPEventArgs(); e.Message = msg.Substring(0, msg.Length -2); m_ftpcom.OnFTPCommand(e); }
public void TransferCompleted(int BytesTransfered, int TimeElapsed) { string s; s = m_dataSock.Response; m_dataSock.Disconnect(); FTPEventArgs e = new FTPCom.FTPEventArgs(); e.TotalBytes = BytesTransfered; e.TimeElapsed = TimeElapsed; e.Message = s; if (m_dataSock.DataCommande == 0) m_ftpcom.OnDirCompleted(e); else if (m_dataSock.DataCommande == 1) m_ftpcom.OnFileDownloadCompleted(e); else m_ftpcom.OnFileUploadCompleted(e); m_dataSock = null; }
private void ftpc_Logged(object sender, FTPCom.FTPEventArgs e) { ftpc.Dir(); }
private void ftpc_Connected(object sender, FTPCom.FTPEventArgs e) { ftpc.Login(); }
public void ftpc_ConnectionTerminated(object sender, FTPCom.FTPEventArgs e) { }