title: anonymous access and file upload through ftp c#
body: <p>Our company web site is hosted in ORCSWEB. Some kind of policy and rule has been set on ORCS end. When people try to access our company ftp with wrong credential 3 times and fail then our ftp will be locked. We often upload file through ftp by programatically but some times found ftp lock. So I talk to orcsweb tech support: they said we are try to access our ftp anonymously by code. So the code which I use to access ftp as follows. So please go through my code and tell me what is wrong in my code which causes anonymous access because I try to access with the right credentials. </p>
  
  <pre><code>public static string IsFtpAccessible(string FTPAddress)
      {
          string strError = "";
          FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(FTPAddress);
          FtpWebResponse res;
          StreamReader reader;
  
          ftp.Credentials = new NetworkCredential("myuserid", "00000password");
          ftp.KeepAlive = false;
          ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
          ftp.UsePassive = true;
          ftp.UseBinary = true;
          ftp.KeepAlive = false;
  
          try
          {
              using (res = (FtpWebResponse)ftp.GetResponse())
              {
                  reader = new StreamReader(res.GetResponseStream());
              }
          }
          catch(Exception ex)
          {
              strError = "ERROR:" + ex.Message.ToString();
          }
          return strError;
      }
  </code></pre>
  
  <p>So tell me what is missing in my code that causes anonymous access.</p>