title: System.Net.WebException: The remote server returned an error: (530) Not logged in
body: <p>I have the same issue as in this question: <a href="https://stackoverflow.com/questions/10352165/using-ftpwebrequest-with-an-error-the-remote-server-returned-error-530-not-loge">using ftpWebRequest with an error: the remote server returned error 530 not logged in</a></p>
  
  <p>I have tried the solutions there, but I can't get past it.</p>
  
  <pre><code>// Get the object used to communicate with the server.
              FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://&lt;ftp-ip&gt;/uploadFTP.txt");
              request.Method = WebRequestMethods.Ftp.UploadFile;
              request.UsePassive = false;
              request.EnableSsl = true;
  
              // This example assumes the FTP site uses anonymous logon.
              request.Credentials = new NetworkCredential(&lt;username&gt;, &lt;password&gt;);
              request.Timeout = -1;
  
              // Copy the contents of the file to the request stream.
              StreamReader sourceStream = new StreamReader(&lt;file to be upload&gt;); 
              byte[] fileContents = Encoding.UTF8.GetBytes(sourceStream.ReadToEnd());
              sourceStream.Close();
              request.ContentLength = fileContents.Length;
  
              Stream requestStream = request.GetRequestStream();
              requestStream.Write(fileContents, 0, fileContents.Length);
              requestStream.Close();
  
              FtpWebResponse response = (FtpWebResponse)request.GetResponse();
  
              //Console.WriteLine("Upload File Complete, status {0}", response.StatusDescription);
  
              response.Close();
  </code></pre>
  
  <p>Where could I possibly be going wrong ? </p>