예제 #1
0
        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;
        }
예제 #2
0
파일: FTPM.cs 프로젝트: spzenk/sfdocsamples
		public FTPMonitor(FTPC ftpcom)
		{

			m_ftpcom = ftpcom;
			m_cmdSock = null;
			m_dataSock = null;
		}
예제 #3
0
 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);
 }
예제 #4
0
파일: FTPM.cs 프로젝트: selenzo/bsuir
 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);
 }
예제 #5
0
파일: FTPM.cs 프로젝트: selenzo/bsuir
        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;
        }
예제 #6
0
 public FTPMonitor(FTPC ftpcom)
 {
     m_ftpcom   = ftpcom;
     m_cmdSock  = null;
     m_dataSock = null;
 }