예제 #1
0
파일: FtpReply.cs 프로젝트: kin988g/FTP
        /// <summary>
        /// Parses the line.
        /// </summary>
        /// <param name="line">The line.</param>
        /// <returns></returns>
        internal bool ParseLine(string line)
        {
            var lastLineMatch = LastLine.Match(line);

            if (lastLineMatch.Success)
            {
                Code = new FtpReplyCode(int.Parse(lastLineMatch.Groups["code"].Value));
                AppendLine(lastLineMatch.Groups["line"].Value);
                return(false);
            }

            var firstLineMatch = FirstLine.Match(line);

            if (firstLineMatch.Success)
            {
                AppendLine(firstLineMatch.Groups["line"].Value);
            }
            else
            {
                AppendLine(line);
            }
            return(true);
        }
예제 #2
0
파일: FtpReply.cs 프로젝트: modulexcite/FTP
        /// <summary>
        /// Parses the line.
        /// </summary>
        /// <param name="line">The line.</param>
        /// <returns></returns>
        internal bool ParseLine(string line)
        {
            var lastLineMatch = LastLine.Match(line);
            if (lastLineMatch.Success)
            {
                Code = new FtpReplyCode(int.Parse(lastLineMatch.Groups["code"].Value));
                AppendLine(lastLineMatch.Groups["line"].Value);
                return false;
            }

            var firstLineMatch = FirstLine.Match(line);
            if (firstLineMatch.Success)
                AppendLine(firstLineMatch.Groups["line"].Value);
            else
                AppendLine(line);
            return true;
        }