Пример #1
0
        /// <summary>
        /// Sets the alert threshold of the passive scanner with the given ID, accepted values for alert threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH
        /// </summary>
        /// <param name="apikey">The api key for the Zap-server</param>
        /// <param name="id">ID of the passive scanner</param>
        /// <param name="alertThreshold">Accepted values for alert threshold: OFF, DEFAULT, LOW, MEDIUM and HIGH</param>
        /// <returns>Result of the action</returns>
        public IApiResult SetScannerAlertThreshold(string apikey, string id, AlertThreshold alertThreshold)
        {
            var parameters = ApikeyHelper.ReturnParameterDictFromApikey(apikey);

            parameters.Add("id", id);
            parameters.Add("alertThreshold", alertThreshold.ToString());
            return(_zapClient.CallApi(Component, ActionTypes.Action, "setScannerAlertThreshold", parameters));
        }
Пример #2
0
        private void SetRegistrySettings()
        {
            try
            {
                RegistryKey currentUserKey = Registry.CurrentUser;
                RegistryKey petKey         = currentUserKey.CreateSubKey(LocalSettingsSubKey);

                petKey.SetValue("TimerInterval", TimerInterval.ToString());
                petKey.SetValue("WarnInterval", WarnInterval.ToString());
                petKey.SetValue("WarnThreshold", WarnThreshold.ToString());
                petKey.SetValue("AlertInterval", AlertInterval.ToString());
                petKey.SetValue("AlertThreshold", AlertThreshold.ToString());
                petKey.SetValue("Action", Action);

                petKey.Close();
                currentUserKey.Close();
            }
            catch (Exception)
            {
                throw;
            }
        }