Is it possible to delete non empty folder in web? I cant delete it using this code as long as its non empty folder.
I can delete files under the folder but folder may consist sub folders too. Whats is the simple way to do this?

  Dim clsRequest As System.Net.FtpWebRequest = _
DirectCast(System.Net.WebRequest.Create("ftp://ftp.server.com/folder), System.Net.FtpWebRequest)

                        clsRequest.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text)
                        '                      

                        clsRequest.Method = System.Net.WebRequestMethods.Ftp.RemoveDirectory


                        Dim response As FtpWebResponse = CType(clsRequest.GetResponse, FtpWebResponse)
                        response.Close()

WebRequestMethods.Ftp is a wrapper for a client of the FTP Internet service. Some FTP Servers support multiple file deletion with the MDEL command, but some don't. It is possible with the mdelete client command to nuke a populated directory, but only if the server allows it. Unfortunately, mdelete is not one of the commands supported by the FTP class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.