private void ServerResponse(object sender, FTPMessageEventArgs e)
        {
            // Get the message
            string message = e.Message;

            // Define regex to check if this is a PUT command containing the path
            // to the asset file on the server. We want to remove this, as
            // it's a bit of a security risk to show this to the user in the FTP log
            const string pattern = @"PUT\s(?<path>[^\s]+)\s(?<filename>[^\s]+)$";
            Regex        regex   = new Regex(pattern, RegexOptions.IgnoreCase);

            // If it is, then strip out the path and replace it with just the filename
            if (regex.Match(message).Success)
            {
                message = regex.Replace(message, "PUT $2 $2");
            }

            // Append this message onto the string
            m_ServerResponses.AppendLine(message);
        }
 private void Connection_CommandSent(object sender, FTPMessageEventArgs e)
 {
     Log.Debug("ftp:reply:{0}", e.Message);
 }
 private void Connection_ReplyReceived(object sender, FTPMessageEventArgs e)
 {
     Log.Debug("ftp:Cmd  :{0}", e.Message);
 }
Example #4
0
 void ftp_ReplyReceived(object sender, FTPMessageEventArgs e)
 {
     replyReceived = true;
 }
Example #5
0
 void ftp_CommandSent(object sender, FTPMessageEventArgs e)
 {
     commandSent = true;
 }
Example #6
0
 // status feedback
 private void HandleMessages(object sender, FTPMessageEventArgs e)
 {
     ShowStatus(3, "FTP: " + e.Message);
 }