示例#1
0
        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
            }
        }
示例#2
0
 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
         {
         }
     }
 }
示例#3
0
文件: SendKeys.cs 项目: JianwenSun/cc
        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
         {
         }
     }
 }