private static void LoadSendMethodFromConfig() { if (!sendMethod.HasValue) { sendMethod = SendMethodTypes.Default; try { // read SendKeys value from config file, not case sensitive string value = System.Configuration.ConfigurationManager.AppSettings.Get("SendKeys"); if (string.IsNullOrEmpty(value)) { return; } if (value.Equals("JournalHook", StringComparison.OrdinalIgnoreCase)) { sendMethod = SendMethodTypes.JournalHook; } else if (value.Equals("SendInput", StringComparison.OrdinalIgnoreCase)) { sendMethod = SendMethodTypes.SendInput; } } catch { } // ignore any exceptions to keep existing SendKeys behavior } }
private static void LoadSendMethodFromConfig() { if (!sendMethod.HasValue) { sendMethod = 1; try { string str = ConfigurationManager.AppSettings.Get("SendKeys"); if (str.Equals("JournalHook", StringComparison.OrdinalIgnoreCase)) { sendMethod = 2; } else if (str.Equals("SendInput", StringComparison.OrdinalIgnoreCase)) { sendMethod = 3; } } catch { } } }
private static void LoadSendMethodFromConfig() { if (!sendMethod.HasValue) { sendMethod = SendMethodTypes.Default; try { // read SendKeys value from config file, not case sensitive string value = System.Configuration.ConfigurationManager.AppSettings.Get("SendKeys"); if (string.IsNullOrEmpty(value)) return; if (value.Equals("JournalHook", StringComparison.OrdinalIgnoreCase)) sendMethod = SendMethodTypes.JournalHook; else if (value.Equals("SendInput", StringComparison.OrdinalIgnoreCase)) sendMethod = SendMethodTypes.SendInput; } catch {} // ignore any exceptions to keep existing SendKeys behavior } }