Beispiel #1
0
        private void GetBill(string touid, bool isDemo, object obj)
        {
            try
            {
                HTTPRequestHeaders header = (HTTPRequestHeaders)obj;
                string             cookie = header["Cookie"];
                string             user   = DataCatchRequest.GetUser(cookie);
                string             key    = string.Format("{0}&{1}", user, touid);
                CacthConfig        config = new CacthConfig(string.Format("{0}GetBillBeginValue", analysisUrl))
                {
                    Cookies = cookie
                };
                //if (!CacthConfig.CatchDic.TryGetValue(key, out config))
                //{
                //    config = new CacthConfig(string.Format("{0}GetBillBeginValue", analysisUrl)) { Cookies = cookie };
                //    CacthConfig.CatchDic.Add(key, config);
                //}
                //config.NewCookies = cookie;

                DataCatchLog log = GetCatchLog(user, isDemo, config);
                log.SetToUser(touid);
                AnsyNet.AnsyDataCatch(config, (tuser, msg) =>
                {
                    if (!string.IsNullOrEmpty(msg.Message))
                    {
                        UpdateUI(log, msg.Message);
                    }
                    switch (msg.Action)
                    {
                    case ActionType.SendRequestData:
                        log.EmitPostDataRequestMsg((IList)msg.Data);
                        break;
                    }
                    return(msg);
                });
            }
            catch (Exception e)
            {
                this.Invoke(new AsynUpdateUI((sn) =>
                {
                    this.textBox1.Text = sn.ToString();
                }), e.Message);
            }
        }