login about faq

I am working on ChillKat Sftp, I need to delete an existing file in the server. I have done this in the regular FTPWebRequest using System.Net.WebRequestMethods.Ftp.DeleteFile.

Do ChillKat supports any inbuilt class for deleting the exitsting file.

 Protected _ftpWebRequest As FtpWebRequest
        Private _userId As String = ""
        Private _domain As String = ""
        Private _uri As String = ""
        Private _password As String = ""
        Private _useBinary As Boolean = False

' Assume that there are correct values for the above variables. Function is working fine for FtpWebRequest Method.

    ' Delete Exiting File
     Public Function DeleteFile(ByVal fileName As String) As Boolean
                    _ftpWebRequest = CType(WebRequest.Create(_uri & fileName), FtpWebRequest)
                    _ftpWebRequest.Credentials = New System.Net.NetworkCredential(_userId, _password, _domain)
                    _ftpWebRequest.Method = WebRequestMethods.Ftp.DeleteFile

                    Dim prxy As New System.Net.WebProxy()
                    prxy.BypassProxyOnLocal = True
                    _ftpWebRequest.Proxy = prxy

                    Using response As FtpWebResponse = CType(_ftpWebRequest.GetResponse(), FtpWebResponse)
                    End Using

                Catch ex As Exception
                    Throw New Exception(ex.Message)
                End Try

                Return True
            End Function

asked Sep 03 '14 at 14:02

chilldll's gravatar image


The method is named RemoveFile. See the online reference documentation...


answered Sep 03 '14 at 15:47

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Sep 03 '14 at 14:02

Seen: 2,797 times

Last updated: Sep 03 '14 at 15:47

powered by OSQA