// If we are already logged in and the server returns 530 then
// the server does not support re-issuing a USER command,
// tear down the connection and start all over again
- if (entry.Command.IndexOf("USER", StringComparison.Ordinal) != -1)
+ if (entry.Command.Contains("USER"))
{
// The server may not require a password for this user, so bypass the password command
if (status == FtpStatusCode.LoggedInProceed)
}
if (_loginState != FtpLoginState.LoggedIn
- && entry.Command.IndexOf("PASS", StringComparison.Ordinal) != -1)
+ && entry.Command.Contains("PASS"))
{
// Note the fact that we logged in
if (status == FtpStatusCode.NeedLoginAccount || status == FtpStatusCode.LoggedInProceed)
else
{
// We only use CWD to reset ourselves back to the login directory.
- if (entry.Command.IndexOf("CWD", StringComparison.Ordinal) != -1)
+ if (entry.Command.Contains("CWD"))
{
_establishedServerDirectory = _requestedServerDirectory;
}
//
// if not check if the user is trying to set chunked:
//
- fChunked = (value.IndexOf(ChunkedHeader, StringComparison.OrdinalIgnoreCase) != -1);
+ fChunked = (value.Contains(ChunkedHeader, StringComparison.OrdinalIgnoreCase));
//
// prevent them from adding chunked, or from adding an Encoding without
return;
}
- fKeepAlive = (value.IndexOf("keep-alive", StringComparison.OrdinalIgnoreCase) != -1);
- fClose = (value.IndexOf("close", StringComparison.OrdinalIgnoreCase) != -1);
+ fKeepAlive = (value.Contains("keep-alive", StringComparison.OrdinalIgnoreCase));
+ fClose = (value.Contains("close", StringComparison.OrdinalIgnoreCase));
//
// Prevent keep-alive and close from being added
// Prevent 100-continues from being added
//
- fContinue100 = (value.IndexOf(ContinueHeader, StringComparison.OrdinalIgnoreCase) != -1);
+ fContinue100 = (value.Contains(ContinueHeader, StringComparison.OrdinalIgnoreCase));
if (fContinue100)
{
{
// string.Empty is a valid uri but not " "
s = TrimString(s);
- if (s.Length == 0 || s.IndexOf("##", StringComparison.Ordinal) != -1)
+ if (s.Length == 0 || s.Contains("##"))
{
throw new FormatException(SR.Format(SR.XmlConvert_BadFormat, s, "Uri"));
}
if (s != null && s.Length > 0)
{ //string.Empty is a valid uri but not " "
s = TrimString(s);
- if (s.Length == 0 || s.IndexOf("##", StringComparison.Ordinal) != -1)
+ if (s.Length == 0 || s.Contains("##"))
{
return new FormatException(SR.Format(SR.XmlConvert_BadFormat, s, "Uri"));
}