コード例 #1
0
        static void Firewall_AccessDenied(string username, string app, string protocol, string source, string destination, string direction)
        {
            try
            {
                if (!Firewall.Apps.Contains(app))
                {
                    if (!SettingsManager.Silence)
                    {
                        Firewall.Apps.Add(app);
                        KavprotVoice.SpeakAsync("Would you like to allow this network access");
                        DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
                        inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Yes | DevComponents.DotNetBar.eTaskDialogButton.No;

                        inf.Title          = "Firewall Rule";
                        inf.Text           = "An application is trying to connect to a remote host (" + destination + ") via " + protocol + " protocol. \n " + Path.GetFileName(app) + "\n do you want to authorize this connection?";
                        inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Exclamation;
                        inf.Header         = "Application Connection";
                        inf.FooterText     = "Kavprot smart security";
                        inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

                        DevComponents.DotNetBar.eTaskDialogResult dl = DevComponents.DotNetBar.TaskDialog.Show(inf);

                        if (dl == DevComponents.DotNetBar.eTaskDialogResult.Yes)
                        {
                            Firewall.Add("AllowAll", app);
                        }
                        else
                        {
                            Firewall.Add("DenyAll", app);
                        }
                    }
                    else
                    {
                        Firewall.Apps.Add(app);
                        if (!Scanner.CheckReputation(app))
                        {
                            Firewall.Add("AllowAll", app);
                        }
                        else
                        {
                            Firewall.Add("DenyAll", app);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex);
            }
            finally
            {
            }
        }
コード例 #2
0
        public static void ScanCompleted()
        {
            KavprotVoice.SpeakAsync("Scan completed successfully");
            AVEngine.EventsManager.CallScanCompleted();
            DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
            inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Ok;

            inf.Title          = "Scan";
            inf.Text           = "Scan completed successfully";
            inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Flag;
            inf.Header         = "Scan completed";
            inf.FooterText     = "Kavprot smart security";
            inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

            DevComponents.DotNetBar.TaskDialog.Show(inf);
        }
コード例 #3
0
        public static DevComponents.DotNetBar.eTaskDialogResult NewDrive(DriveInfo drv)
        {
            KavprotVoice.SpeakAsync("New Drive detected. would you like to scan it ?");
            AVEngine.EventsManager.CallNewDriveConnected();
            DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
            inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Yes | DevComponents.DotNetBar.eTaskDialogButton.No;

            inf.Title          = "New drive Detected (" + drv.Name + ") " + drv.VolumeLabel;
            inf.Text           = "New Drive detected do you want to scan it";
            inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Exclamation;
            inf.Header         = "New Drive Connected";
            inf.FooterText     = "Kavprot smart security";
            inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

            DevComponents.DotNetBar.eTaskDialogResult dl = DevComponents.DotNetBar.TaskDialog.Show(inf);
            return(dl);
        }
コード例 #4
0
        public static void UpdateProg(string current, string dest, string path)
        {
            KavprotVoice.SpeakAsync("Do you want to upgrade Kavprot smart security From " + current + " To " + dest);
            DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
            inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Yes | DevComponents.DotNetBar.eTaskDialogButton.No;

            inf.Title          = "New Version ready to be installed";
            inf.Text           = string.Format("Kavprot smart security downloaded the update package. if you want to upgrade this version from {0} to {1} click 'yes' if not click 'no'.", current, dest);
            inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Flag;
            inf.Header         = "Scan completed";
            inf.FooterText     = "Kavprot smart security";
            inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

            var result = DevComponents.DotNetBar.TaskDialog.Show(inf);

            if (result == DevComponents.DotNetBar.eTaskDialogResult.Yes)
            {
                Process.Start(Application.StartupPath + @"\KPAVUPDATE.exe", path);
                Application.Exit();
            }
        }