Exemplo n.º 1
0
        public async void DeleteFtpDirectoryAsync(string ip, string remoteFilePath, string userName, string password, bool isUsePassive, CallbackContext callbackContext)
        {
            m_Logger.Debug($"ip:{ip},remoteFilePath:{remoteFilePath}");
            try
            {
                FTPClient ftpClient = new FTPClient($"ftp://{ip}");
                var       ftpResult = await ftpClient.DeleteDirectoryAsync(remoteFilePath, userName, password, isUsePassive);

                callbackContext.SendPluginResult(new PluginResult(PluginResult.Status.OK, ftpResult));
            }
            catch (Exception e)
            {
                m_Logger.Error(e);
                callbackContext.Error(new
                {
                    type    = "Exception",
                    code    = "",
                    message = e.Message,
                    details = e.StackTrace
                });
            }
        }