📅  最后修改于: 2022-03-11 14:48:49.484000             🧑  作者: Mango
private string DeleteFile(string fileName)
{
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://www.server.com/" + fileName);
request.Method = WebRequestMethods.Ftp.DeleteFile;
request.Credentials = new NetworkCredential("username", "password");
using (FtpWebResponse response = (FtpWebResponse)request.GetResponse())
{
return response.StatusDescription;
}
}