Delete a file


using System;
using System.Net;
using System.Threading;
using System.IO;
using System.Text;
class ThreadTest
{
    static void Main()
    {
        var req = (FtpWebRequest)WebRequest.Create("ftp://ftp.yourFtp.com/deleteme.txt");
        req.Proxy = null;
        req.Credentials = new NetworkCredential("nutshell", "yourValue");

        req.Method = WebRequestMethods.Ftp.DeleteFile;

        req.GetResponse().Close();  // Perform the deletion

    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.