internal SessionConnected(Session h, ControlChannel ctrl, bool caseInsensitive) { m_host = h; m_ctrlChannel = ctrl; m_ctrlChannel.Session = this; m_caseInsensitive = caseInsensitive; }
internal OutputDataStream(ControlChannel ctrl, TcpClient client) : base(ctrl, client) { }
public void Connect(string UserName, string Password) { ControlChannel ctrl = new ControlChannel(m_host); ctrl.Server = m_server; ctrl.Port = m_port; ctrl.Connect(); try { ctrl.Command("USER " + UserName); if (ctrl.LastResponse.Code == Response.UserAcceptedWaitingPass) ctrl.Command("PASS " + Password); if (ctrl.LastResponse.Code != Response.UserLoggedIn) throw new AuthenticationException("Failed to login.", ctrl.LastResponse); m_host.State = new SessionConnected(m_host, ctrl, m_caseInsensitive); ((SessionConnected)m_host.State).InitRootDirectory(); } catch { ctrl.Close(); throw; } }