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; }
public FTPMonitor(FTPC ftpcom) { m_ftpcom = ftpcom; m_cmdSock = null; m_dataSock = null; }
private void CreateDataSocket(string ipaddress, int port) { m_dataSock = new DataAsyncSocket(this); if (m_NextCommand.Command == "LIST") { m_dataSock.DataCommande = 0; } else { if (m_NextCommand.Command == "RETR") { m_dataSock.Filename = m_ftpcom.LocalFolder + "\\" + m_NextCommand.sParam; m_dataSock.FileSize = m_NextCommand.iParam; m_dataSock.DataCommande = 1; } else { m_dataSock.Filename = m_ftpcom.LocalFolder + "\\" + m_NextCommand.sParam; m_dataSock.FileSize = m_NextCommand.iParam; m_dataSock.DataCommande = 2; } } m_dataSock.Connect(ipaddress, port); }
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; }