Exemple #1
0
 public static void AppendUserAgent(string appendUserAgent)
 {
     if (string.IsNullOrEmpty(UserAgentHelper.string_0))
     {
         UserAgentHelper.string_0 = UserAgentHelper.smethod_0();
     }
     UserAgentHelper.ChangeUserAgent(appendUserAgent);
 }
Exemple #2
0
 public TaobaoLoginForm(string[] args)
 {
     try
     {
         if ((args == null ? true : (int)args.Length == 0))
         {
             MessageBox.Show(string.Concat("版本:[V", this.int_0, "],本程序不能手动打开!"));
             Environment.Exit(-1);
         }
         if (args[0].Contains("CheckUpdVersion"))
         {
             Environment.Exit(this.int_0);
         }
         this.InitializeComponent();
         base.FormClosing += new FormClosingEventHandler(this.TaobaoLoginForm_FormClosing);
         UserAgentHelper.AppendUserAgent("Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
         this.webBrowserLoginAlimama.ScriptErrorsSuppressed         = true;
         this.webBrowserLoginAlimama.IsWebBrowserContextMenuEnabled = false;
         this.method_0();
         this.method_9(string.Concat("当前IE版本:[", this.webBrowserLoginAlimama.Version.ToString(), "]"));
         int num  = 0;
         int num1 = 0;
         num = num1 + 1;
         this.mainFormTitle = args[num1];
         int num2 = 1;
         num = num2 + 1;
         if (int.Parse(args[num2]) != 1)
         {
             this.webBrowserLoginAlimama.Navigate(this.string_2);
             (new Thread(new ThreadStart(this.checkManualLogin))).Start();
         }
         else
         {
             this.webBrowserLoginAlimama.Navigate(this.string_3);
             int num3 = num;
             num           = num3 + 1;
             this.username = args[num3];
             int num4 = num;
             num           = num4 + 1;
             this.password = args[num4];
             int num5 = num;
             num = num5 + 1;
             if (int.Parse(args[num5]) != 1)
             {
                 this.string_0 = "";
                 this.string_1 = "";
             }
             else
             {
                 int num6 = num;
                 num           = num6 + 1;
                 this.string_0 = args[num6];
                 int num7 = num;
                 num           = num7 + 1;
                 this.string_1 = args[num7];
             }
             this.Text    = string.Concat(this.Text, " - 自动登录模式,如果没出错,不要手动操作");
             this.timer_0 = new System.Windows.Forms.Timer()
             {
                 Interval = 3000
             };
             this.timer_0.Tick += new EventHandler(this.timer_0_Tick);
             this.timer_0.Start();
             (new Thread(new ThreadStart(this.checkAutoLogin))).Start();
         }
         (new Thread(new ThreadStart(this.setWindowFront))).Start();
     }
     catch (Exception exception1)
     {
         Exception exception = exception1;
         if (!exception.ToString().Contains("System.IndexOutOfRangeException"))
         {
             this.method_9(string.Concat("[AlimamaLoginForm]出错!", exception.ToString()));
         }
         else
         {
             this.sendMsgToMainFormAndExit("close", CUtil.FORM_MSG_TYPE_CLOSENOTLOGINED);
         }
     }
 }
Exemple #3
0
 public static void ChangeUserAgent(string userAgent)
 {
     UserAgentHelper.UrlMkSetSessionOption(268435457, userAgent, userAgent.Length, 0);
 }