Пример #1
0
 internal FtpResumeNotSupportedException(FtpResponse ftpResponse)
     : base("Data transfer error: server don't support resuming", ftpResponse)
 {
 }
Пример #2
0
 internal FtpException(string message, FtpResponse ftpResponse)
     : base(message)
 {
     m_ftpResponse	= ftpResponse;
 }
Пример #3
0
 internal FtpServerDownException(FtpResponse ftpResponse)
     : base("FTP service was down.",ftpResponse)
 {
 }
Пример #4
0
 internal void Connect()
 {
     m_connection.Connect(m_server, m_port);
     try {
         m_lastResponse = new FtpResponse(m_connection.GetStream());
         if(m_lastResponse.Code != FtpResponse.ServiceReady)
             throw new FtpException("Ftp service unavailable.", m_lastResponse);
     }catch{
         Close();
         throw;
     }
 }
Пример #5
0
 public void RefreshResponse()
 {
     lock(this)
         m_lastResponse = new FtpResponse(m_connection.GetStream());
     foreach(string s in m_lastResponse.Respones)
         m_sessionHost.RaiseResponseEvent(s);
 }
Пример #6
0
        public void FtpCommand(string cmd)
        {
            m_sessionHost.RaiseCommandEvent(cmd);

            byte[] buff		= System.Text.Encoding.Default.GetBytes(cmd + "\r\n");
            Stream stream	= m_connection.GetStream();

            lock(this) {
                stream.Write(buff, 0, buff.Length);
                m_lastResponse = new FtpResponse(stream);
            }
            foreach(string s in m_lastResponse.Respones)
                m_sessionHost.RaiseResponseEvent(s);
        }