示例#1
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 /// <param name="session">Reference to Pop33 session.</param>
 /// <param name="userName">Username.</param>
 /// <param name="passwData">Password data.</param>
 /// <param name="data">Authentication specific data(as tag).</param>
 /// <param name="authType">Authentication type.</param>
 public AuthUser_EventArgs(FTP_Session session, string userName, string passwData, string data, AuthType authType)
 {
     m_pSession  = session;
     m_UserName  = userName;
     m_PasswData = passwData;
     m_Data      = data;
     m_AuthType  = authType;
 }
示例#2
0
        internal FileSysEntry_EventArgs OnGetDirInfo(FTP_Session session, string dir)
        {
            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, "");

            if (this.GetDirInfo != null)
            {
                this.GetDirInfo(this, oArg);
            }
            return(oArg);
        }
示例#3
0
        internal bool OnDeleteDir(FTP_Session session, string dir)
        {
            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, dir, "");

            if (this.DeleteDir != null)
            {
                this.DeleteDir(this, oArg);
            }

            return(oArg.Validated);
        }
示例#4
0
        internal bool OnRenameDirFile(FTP_Session session, string from, string to)
        {
            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, from, to);

            if (this.RenameDirFile != null)
            {
                this.RenameDirFile(this, oArg);
            }

            return(oArg.Validated);
        }
示例#5
0
        internal Stream OnStoreFile(FTP_Session session, string file)
        {
            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, "");

            if (this.StoreFile != null)
            {
                this.StoreFile(this, oArg);
            }

            return(oArg.FileStream);
        }
示例#6
0
        internal bool OnDeleteFile(FTP_Session session, string file)
        {
            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, "");

            if (this.DeleteFile != null)
            {
                this.DeleteFile(this, oArg);
            }

            return(oArg.Validated);
        }
示例#7
0
        /// <summary>
        /// Authenticates user.
        /// </summary>
        /// <param name="session">Reference to current Pop33 session.</param>
        /// <param name="userName">User name.</param>
        /// <param name="passwData"></param>
        /// <param name="data"></param>
        /// <param name="authType"></param>
        /// <returns></returns>
        internal virtual bool OnAuthUser(FTP_Session session, string userName, string passwData, string data, AuthType authType)
        {
            AuthUser_EventArgs oArg = new AuthUser_EventArgs(session, userName, passwData, data, authType);

            if (this.AuthUser != null)
            {
                this.AuthUser(this, oArg);
            }

            return(oArg.Validated);
        }
		/// <summary>
		/// Default constructor.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="newName"></param>
		/// <param name="session"></param>
		public FileSysEntry_EventArgs(FTP_Session session,string name,string newName)
		{			
			m_Name    = name;
			m_NewName = newName;

			m_DsDirInfo  = new DataSet();
			DataTable dt = m_DsDirInfo.Tables.Add("DirInfo");
			dt.Columns.Add("Name");
			dt.Columns.Add("Date",typeof(DateTime));
			dt.Columns.Add("Size",typeof(long));
			dt.Columns.Add("IsDirectory",typeof(bool));
		}
示例#9
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="newName"></param>
        /// <param name="session"></param>
        public FileSysEntry_EventArgs(FTP_Session session, string name, string newName)
        {
            m_Name    = name;
            m_NewName = newName;

            m_DsDirInfo = new DataSet();
            DataTable dt = m_DsDirInfo.Tables.Add("DirInfo");

            dt.Columns.Add("Name");
            dt.Columns.Add("Date", typeof(DateTime));
            dt.Columns.Add("Size", typeof(long));
            dt.Columns.Add("IsDirectory", typeof(bool));
        }
示例#10
0
        internal bool OnFileExists(FTP_Session session, string file)
        {
            // Remove last /
            file = file.Substring(0, file.Length - 1);

            FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session, file, "");

            if (this.FileExists != null)
            {
                this.FileExists(this, oArg);
            }

            return(oArg.Validated);
        }
示例#11
0
		internal bool OnDeleteFile(FTP_Session session,string file)
		{
			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,file,"");
			if(this.DeleteFile != null){
				this.DeleteFile(this,oArg);
			}
			
			return oArg.Validated;
		}
示例#12
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="socket"></param>
		protected override void InitNewSession(Socket socket)
		{
			SocketLogger logger = new SocketLogger(socket,this.SessionLog);
			FTP_Session session = new FTP_Session(socket,this,Guid.NewGuid().ToString(),logger);
		}
示例#13
0
		/// <summary>
		/// Authenticates user.
		/// </summary>
		/// <param name="session">Reference to current Pop33 session.</param>
		/// <param name="userName">User name.</param>
		/// <param name="passwData"></param>
		/// <param name="data"></param>
		/// <param name="authType"></param>
		/// <returns></returns>
		internal virtual bool OnAuthUser(FTP_Session session,string userName,string passwData,string data,AuthType authType) 
		{				
			AuthUser_EventArgs oArg = new AuthUser_EventArgs(session,userName,passwData,data,authType);
			if(this.AuthUser != null){
				this.AuthUser(this,oArg);
			}
			
			return oArg.Validated;
		}
示例#14
0
		internal FileSysEntry_EventArgs OnGetDirInfo(FTP_Session session,string dir)
		{
			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,dir,"");
			if(this.GetDirInfo != null){
				this.GetDirInfo(this,oArg);
			}
			return oArg;
		}
示例#15
0
		internal bool OnDeleteDir(FTP_Session session,string dir)
		{
			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,dir,"");
			if(this.DeleteDir != null){
				this.DeleteDir(this,oArg);
			}
			
			return oArg.Validated;
		}
示例#16
0
		internal bool OnRenameDirFile(FTP_Session session,string from,string to)
		{
			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,from,to);
			if(this.RenameDirFile != null){
				this.RenameDirFile(this,oArg);
			}
			
			return oArg.Validated;
		}
示例#17
0
		internal bool OnFileExists(FTP_Session session,string file)
		{
			// Remove last /
			file = file.Substring(0,file.Length - 1);

			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,file,"");
			if(this.FileExists != null){
				this.FileExists(this,oArg);
			}
			
			return oArg.Validated;
		}
示例#18
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="socket"></param>
 protected override void InitNewSession(Socket socket)
 {
     SocketLogger logger  = new SocketLogger(socket, this.SessionLog);
     FTP_Session  session = new FTP_Session(socket, this, Guid.NewGuid().ToString(), logger);
 }
示例#19
0
		internal Stream OnStoreFile(FTP_Session session,string file)
		{
			FileSysEntry_EventArgs oArg = new FileSysEntry_EventArgs(session,file,"");
			if(this.StoreFile != null){
				this.StoreFile(this,oArg);
			}
			
			return oArg.FileStream;
		}