title: FTP create folder and upload files in C#
body: <p>so I'm trying to automate some uploading to an ftp, but I cannot get it to work. What I have is (trying to create a folder):</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      FTPUpload(txtIP.Text, txtUName.Text, txtPWord.Text);
  }
  
  private void FTPUpload(string ftpAddress, string ftpUName, string ftpPWord)
  {
      FtpWebRequest ftpRequest = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpAddress + "/AUTO_TEST_FOLDER"));
      ftpRequest.Credentials = new NetworkCredential(ftpUName, ftpPWord);
      ftpRequest.Method = WebRequestMethods.Ftp.MakeDirectory;
      WebResponse response = ftpRequest.GetResponse();
      using (var resp = (FtpWebResponse)ftpRequest.GetResponse())
      {
          MessageBox.Show(resp.StatusCode.ToString());
      }
  </code></pre>
  
  <p>I keep getting WebException was Unhandled "The remote server returned an error: (550) File unavailable (e.g., file not found, no access)." at line <code>WebResponse response = ftpRequest.GetResponse();</code>.</p>
  
  <p>Can someone help me out here?</p>
  
  <p>I've tried a couple of solutions, including the answer at <a href="https://stackoverflow.com/questions/860638/how-do-i-create-a-directory-on-ftp-server-using-c">How do I create a directory on ftp server using C#?</a>, but with no success (no success with even copy/pasting that answer and entering my ip/uname/pword).</p>