i am trying to delete a file from my FTP website but i cannot seem to get the code to work could anyone help?, i get no error’s it just doesn’t do anything.
private FtpWebRequest deleteRequest(string uri, string method)
{
var r = (FtpWebRequest)WebRequest.Create(uri);
string Delete = WebRequestMethods.Ftp.DeleteFile;
r.Credentials = new NetworkCredential(TxtUsername.Text, TxtPassword.Text);
r.Method = Delete = listView1.SelectedItems.ToString();
return r;
}
The rest of the code.
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Text = TxtServer.Text + listView1.SelectedItems.ToString();
deleteRequest(textBox1.Text, WebRequestMethods.Ftp.DeleteFile);
}
This is the code i ended up using thank you all for the help really appreciate it.
I just fully rewrote the code and tried again and it worked.