-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMainC.cs
148 lines (128 loc) · 4.94 KB
/
MainC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using KAVE.Engine;
using KAVE;
using KAVE.BaseEngine;
using DevComponents.DotNetBar;
using System.Diagnostics;
namespace Kavprot
{
public partial class MainC : UserControl
{
public MainC()
{
InitializeComponent();
this.userlb.Text = "<div align=\"right\"><font size=\"+4\">" + Activation.User + "</font><br/></div>";
LoadStats();
AVEngine.EventsManager.FileChanged += new EventHandler(pfrm_PSLChanged);
AVEngine.EventsManager.WebChanged += new EventHandler(wprot_WSLChanged);
}
int scannedfiles = 0;
void pfrm_PSLChanged(object sender, EventArgs e)
{
try
{
scannedfiles++;
Forms.frm.sflb.Text = "SF : " + scannedfiles;
}
catch (Exception ex)
{
AntiCrash.LogException(ex);
}
}
int scannedwebsites = 0;
void wprot_WSLChanged(object sender, EventArgs e)
{
try
{
scannedwebsites++;
Forms.frm.swlb.Text = "SW : " + scannedwebsites;
}
catch (Exception ex)
{
AntiCrash.LogException(ex);
}
}
internal void LoadStats()
{
if (!KavprotManager.Protected)
{
protstat.Text = "Computer is unprotected";
protstat.ForeColor = Color.Silver;
labelX1.Text = "Protection : Disabled";
labelX1.ForeColor = Color.Silver;
protimgbox.Image = Kavprot.Properties.Resources.monitor_red;
}
else if (!(SettingsManager.SystemMonitor && SettingsManager.WebAgent && SettingsManager.NIDS && SettingsManager.Firewall))
{
protstat.Text = "Computer is partially protected";
protstat.ForeColor = Color.Orange;
labelX1.Text = "Protection : Partially protected";
labelX1.ForeColor = Color.Orange;
protimgbox.Image = Kavprot.Properties.Resources.monitor_red;
}
else
{
protstat.Text = "Computer is protected";
protstat.ForeColor = Color.White;
labelX1.Text = "Protection : Active";
labelX1.ForeColor = Color.White;
protimgbox.Image = Kavprot.Properties.Resources.monitor_green;
}
threatlb.Text = "Threats : " + KavprotManager.LastThreat;
labelX2.Text = "Databases : " + VDB.version;
TimeSpan ts = Activation.Expiration.Subtract(DateTime.Now);
labelX3.Text = "License : " + Math.Abs(ts.Days) + " Days " + Math.Abs(ts.Hours) + " Hours " + Math.Abs(ts.Minutes) + " Minutes";
}
void Updatewsc(string text, LabelX CurFile)
{
CurFile.Text = text;
}
private void avpbtn_Click(object sender, EventArgs e)
{
AVPC a = (AVPC)Forms.GetControl("avp");
a.SLoad();
Forms.frm.ShowModalPanel(a, DevComponents.DotNetBar.Controls.eSlideSide.Right);
}
private void sfgbtn_Click(object sender, EventArgs e)
{
FirewallC a = (FirewallC)Forms.GetControl("firewall");
a.SLoad();
Forms.frm.ShowModalPanel(a, DevComponents.DotNetBar.Controls.eSlideSide.Left);
}
private void csbtn_Click(object sender, EventArgs e)
{
ScanTypeFrm a = (ScanTypeFrm)Forms.GetControl("scan");
Forms.frm.ShowModalPanel(a, DevComponents.DotNetBar.Controls.eSlideSide.Bottom);
}
private void fdoctbtn_Click(object sender, EventArgs e)
{
Utilities a = (Utilities)Forms.GetControl("utils");
Forms.frm.ShowModalPanel(a, DevComponents.DotNetBar.Controls.eSlideSide.Top);
}
private void vqbtn_Click(object sender, EventArgs e)
{
Quarantinefrm a = (Quarantinefrm)Forms.GetControl("quarantine");
Forms.frm.ShowModalPanel(a, DevComponents.DotNetBar.Controls.eSlideSide.Left);
}
private void settingbtn_Click(object sender, EventArgs e)
{
//if (Process.GetProcessesByName("KAI").Length == 0)
// Process.Start(Application.StartupPath + @"\KAI.exe");
}
private void logbtn_Click(object sender, EventArgs e)
{
Process.Start(Application.StartupPath + @"\Logs\Errors.txt");
}
private void sndbtn_Click(object sender, EventArgs e)
{
if (openFileDialog2.ShowDialog() == DialogResult.OK)
Process.Start(Application.StartupPath + @"\SandBox.exe", "\"" + openFileDialog2.FileName + "\"");
}
}
}