private string Type(string typeCode, string formatControl) { switch (typeCode.ToUpperInvariant()) { case "A": _connectionType = TransferType.Ascii; break; case "I": _connectionType = TransferType.Image; break; default: return("504 Command not implemented for that parameter"); } if (!string.IsNullOrWhiteSpace(formatControl)) { switch (formatControl.ToUpperInvariant()) { case "N": _formatControlType = FormatControlType.NonPrint; break; default: return("504 Command not implemented for that parameter"); } } return(string.Format("200 Type set to {0}", _connectionType)); }
private string Type(string typeCode, string formatControl) { switch (typeCode.ToUpperInvariant()) { case "A": _connectionType = TransferType.Ascii; break; case "I": _connectionType = TransferType.Image; break; default: return("504 Command not implemented for that parameter"); } if (!string.IsNullOrWhiteSpace(formatControl)) { switch (formatControl.ToUpperInvariant()) { case "N": _formatControlType = FormatControlType.NonPrint; break; default: return("504 Command not implemented for that parameter"); } } // eschew 'field assigned but its value is never used' warning System.Diagnostics.Debug.WriteLine($"_formatControlType = {_formatControlType}"); return(string.Format("200 Type set to {0}", _connectionType)); }
/// <summary> /// TYPE Command - RFC 959 - Section 4.1.2 /// </summary> /// <param name="username"></param> /// <returns></returns> private Response Type(string typeCode, string formatControl) { switch (typeCode.ToUpperInvariant()) { case "A": _connectionType = TransferType.Ascii; break; case "I": _connectionType = TransferType.Image; break; default: return GetResponse(FtpResponses.NOT_IMPLEMENTED_FOR_PARAMETER); } if (!string.IsNullOrWhiteSpace(formatControl)) { switch (formatControl.ToUpperInvariant()) { case "N": _formatControlType = FormatControlType.NonPrint; break; default: return GetResponse(FtpResponses.NOT_IMPLEMENTED_FOR_PARAMETER); } } return GetResponse(FtpResponses.OK); }
private string Type(string typeCode, string formatControl) { switch (typeCode.ToUpperInvariant()) { case "A": _connectionType = TransferType.Ascii; break; case "I": _connectionType = TransferType.Image; break; default: return "504 Command not implemented for that parameter"; } if (!string.IsNullOrWhiteSpace(formatControl)) { switch (formatControl.ToUpperInvariant()) { case "N": _formatControlType = FormatControlType.NonPrint; break; default: return "504 Command not implemented for that parameter"; } } return string.Format("200 Type set to {0}", _connectionType); }