示例#1
0
        // 환불 승인 처리
        public virtual bool Refund(string cpcode)
        {
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        useurl       = pCrawlerInfo.RUseUserUrl_;
            string        useparam     = pCrawlerInfo.RUseUserParam_;

            useparam = useparam.Replace("{CouponCode}", cpcode);

            LogManager.Instance.Log(useurl);
            LogManager.Instance.Log(useparam);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(pCrawlerInfo.RUseUserCheck_) < 0)
            {
                LogManager.Instance.Log("public virtual bool Refund(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#2
0
        bool use_step_2(string ticketcode)
        {
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        useurl       = str_use_url_2_;
            string        useparam     = str_use_param_2_;

            useparam = useparam.Replace("{TicketCode}", ticketcode);

            LogManager.Instance.Log(useurl);
            LogManager.Instance.Log(useparam);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(str_use_check_2_) < 0)
            {
                LogManager.Instance.Log("public override bool use_step_2(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#3
0
        // 사용 처리 2단계
        bool use_step_2(string ticketcode)
        {
            try
            {
                string useurl   = str_use_url_2_;
                string useparam = str_use_param_2_;

                useparam = useparam.Replace("{TicketCode}", ticketcode);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(str_use_check_2_) < 0)
                {
                    NewLogManager2.Instance.Log("public override bool use_step_2(string cpcode) " + htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool use_step_2( - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#4
0
        public virtual bool First_UseData(Int32 goodsSeq, string cpcode, string goodscode)
        {
            // 웹 호출을 통해서 사용처리한다.
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        useurl       = pCrawlerInfo.UseUserUrl_;
            string        useparam     = pCrawlerInfo.UseUserParam_;

            string[] cpcodeArray = cpcode.Split('_');
            cpcode = cpcodeArray[0];

            useparam = useparam.Replace("{CouponCode}", cpcode);

            LogManager.Instance.Log(useurl);
            LogManager.Instance.Log(useparam);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(pCrawlerInfo.UseUserCheck_) < 0)
            {
                LogManager.Instance.Log("public virtual bool Use_Deal(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#5
0
        bool use_step_3(string ticketcode, string cpcode)
        {
            string useurl   = str_use_url_3_;
            string useparam = str_use_param_3_;

            string[] cpcodeArray = cpcode.Split('_');
            cpcode = cpcodeArray[0];

            useparam = useparam.Replace("{CouponCode}", cpcode);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(str_use_check_2_) < 0)
            {
                NewLogManager2.Instance.Log("public override bool use_step_2(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#6
0
        // 로그인 Web
        public override bool Web_Login()
        {
            Cookie_ = new CookieContainer();

            try
            {
                string loginurl    = LQCrawlerInfo_.LoginUrl_;
                string loginstring = LQCrawlerInfo_.LoginParam_.Replace("{LoginID}", LQCrawlerInfo_.LoginID_);
                loginstring = loginstring.Replace("{LoginPW}", LQCrawlerInfo_.LoginPW_);
                byte[] sendData = UTF8Encoding.UTF8.GetBytes(loginstring);

                HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest(LQCrawlerInfo_.LoginMethod_, loginurl, loginstring, Cookie_);
                TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string          htmlBuffer = r.ReadToEnd();

                //if (htmlBuffer.IndexOf(LQCrawlerInfo_.LoginCheck_) < 0)
                //   return false;
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
示例#7
0
        // 환불 승인 처리
        public override bool Refund(string cpcode)
        {
            // 웹 호출을 통해서 사용처리한다.
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        useurl       = pCrawlerInfo.RUseUserUrl_;
            string        useparam     = pCrawlerInfo.RUseUserParam_;

            // 두번째 쿠폰 코드 찾기
            Int32  n      = cpcode.IndexOf('-');
            Int32  nCount = cpcode.Length - (n + 1);
            string cp_sub = cpcode.Substring(n + 1, nCount);

            useparam = useparam.Replace("{CouponCode2}", cp_sub);


            LogManager.Instance.Log(useurl);
            LogManager.Instance.Log(useparam);

            HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, cookie_);
            TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string          htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(pCrawlerInfo.RUseUserCheck_) < 0)
            {
                LogManager.Instance.Log("public virtual bool Refund(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#8
0
        // 상품 사용처리
        bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                string useurl   = LQCrawlerInfo_.UseUserUrl_;
                string useparam = LQCrawlerInfo_.UseUserParam_;

                useparam = useparam.Replace("{CouponCode}", cpcode);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();


                string useCheck = @"\uc2e4\ud328\ud558\uc600\uc2b5\ub2c8\ub2e4.\uc774\ubbf8 \uc0ac\uc6a9\ub41c \ud2f0\ucf13\uc785\ub2c8\ub2e4.";
                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0 && htmlBuffer.IndexOf(useCheck) < 0)
                {
                    NewLogManager2.Instance.Log("public virtual bool Use_Deal(string cpcode) " + htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Use_Deal - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#9
0
        // 로그인
        public virtual bool Login()
        {
            LQStructures.LQCrawlerInfo pCrawler = CrawlerManager.Instance.GetCrawlerInfo();
            cookie_ = new CookieContainer();

            try
            {
                string loginurl    = pCrawler.LoginUrl_;
                string loginstring = pCrawler.LoginParam_.Replace("{LoginID}", pCrawler.LoginID_);
                loginstring = loginstring.Replace("{LoginPW}", pCrawler.LoginPW_);
                byte[] sendData = UTF8Encoding.UTF8.GetBytes(loginstring);

                HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest(pCrawler.LoginMethod_, loginurl, loginstring, cookie_);
                TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string          htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(pCrawler.LoginCheck_) < 0)
                {
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
示例#10
0
        public bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            // 웹 호출을 통해서 사용처리한다.
            string useurl   = LQCrawlerInfo_.UseUserUrl_;
            string useparam = LQCrawlerInfo_.UseUserParam_;
            string cpcode2  = "";

            cpcode2 = cpcode.Substring(cpcode.Length - 5);

            useparam = useparam.Replace("{CouponCode}", cpcode);
            useparam = useparam.Replace("{TicketCode}", cpcode2);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
            {
                NewLogManager2.Instance.Log("public virtual bool Use_Deal(string cpcode) " + htmlBuffer);
                return(false);
            }

            return(true);
        }
示例#11
0
        bool GetUseTicketInfo(string couponcode, string goodscode, ref string ticketcode)
        {
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        strurl       = pCrawlerInfo.UseGoodsUrl_;
            string        strparam     = pCrawlerInfo.UseGoodsParam_;

            strparam = strparam.Replace("{CouponCode}", couponcode);
            strparam = strparam.Replace("{GoodsCode}", goodscode);

            LogManager.Instance.Log(strurl);
            LogManager.Instance.Log(strparam);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", strurl, strparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(pCrawlerInfo.UseGoodsCheck_) < 0)
            {
                LogManager.Instance.Log(htmlBuffer);
                return(false);
            }

            Regex           re = new Regex(pCrawlerInfo.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(htmlBuffer);

            ticketcode = oe[0].Groups["CouponCode2"].ToString();

            return(true);
        }
示例#12
0
        public bool Down_stap1(ref string secureKey, string sData, string eDate)
        {
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            Dictionary <Int32, ChannelGoodInfo> pInfoList = CrawlerManager.Instance.GetGoodsInfo();

            DateTime dtNow = DateTime.Now;

            string strurl    = str_down_url_1_;
            string strparam  = @"sch_date_type=ORDER_DATE&sch_rpt_status=&sch_sel_svcd_name=%BC%AD%BA%F1%BD%BA+%C0%FC%C3%BC&afterLogURL=%2Fwl%2Fservlets%2Ftbs.pmt.servlets.PayMainBackServlet%3Faction%3Dlist&type=I&curPage=1&sch_value=&sch_sel_vendor=leisureq&sch_sel_cmpy=&sch_sel_method_name=%B0%E1%C1%A6%B9%E6%B9%FD%C0%FC%C3%BC&sch_sel_method=&sch_to_order_date=2014-07-24&sch_fr_order_date=2014-07-24&xls=Y&sch_field=USER_NAME&sch_ord_status=&sch_pmt_status=&sch_sel_svcd=&sch_item=&ACCESS_TYPE=XLS&ACCESS_REASON=%BE%F7%B9%AB%BF%EB&ACCESS_ADMIN=E&DATA_MASK_YN=Y&ACCESS_AGREE=";//str_down_param_1_;
            string regstring = @"<input&nbsp;type=""hidden""&nbsp;name=""ACCESS_NO""&nbsp;value=""(?<SecurityKey>\S+)"">""";

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", strurl, strparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(str_down_check_1_) < 0)
            {
                LogManager.Instance.Log(htmlBuffer);
                return(false);
            }

            Regex           re = new Regex(regstring, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(htmlBuffer);

            secureKey = oe[0].Groups["TicketCode"].ToString();

            return(true);
        }
示例#13
0
        public override bool Login()
        {
            LQStructures.LQCrawlerInfo pCrawler = CrawlerManager.Instance.GetCrawlerInfo();
            cookie_ = new CookieContainer();


            // 1차 쿠키 받아오는곳
            try
            {
                string loginurl = "https://partneradmin.ezwel.com/cpadm/login/loginForm.ez";

                HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest("GET", loginurl, "", cookie_);
                TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding("EUC-KR"));
                string          htmlBuffer = r.ReadToEnd();
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
            }

            // 2차 로그인 처리
            try
            {
                string loginurl       = "https://partneradmin.ezwel.com/cpadm/login/newLoginCheckAction.ez";
                string loginparameter = "&userId={0}&password={1}";
                loginparameter = string.Format(loginparameter, pCrawler.LoginID_, pCrawler.LoginPW_);

                HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest("POST", loginurl, loginparameter, cookie_);
                TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding("EUC-KR"));
                string          htmlBuffer = r.ReadToEnd();
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
            }

            // 실제 로그인
            try
            {
                string loginurl    = pCrawler.LoginUrl_;
                string loginstring = pCrawler.LoginParam_.Replace("{LoginID}", pCrawler.LoginID_);
                loginstring = loginstring.Replace("{LoginPW}", pCrawler.LoginPW_);
                //byte[] sendData = UTF8Encoding.UTF8.GetBytes(loginstring);

                HttpWebResponse pResponse  = HKHttpWebRequest.ReqHttpRequest(pCrawler.LoginMethod_, loginurl, loginstring, cookie_);
                TextReader      r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string          htmlBuffer = r.ReadToEnd();

                //if (htmlBuffer.IndexOf(pCrawler.LoginCheck_) < 0)
                //    return false;
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
示例#14
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string method = "GET";
                string url    = @"http://biz.wemakeprice.com/dealer/deal_list/do_xsl_download/{GoodsCode}/1";

                DateTime dtNow = DateTime.Now;

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                foreach (var pData in GoodsInfoList_)
                {
                    if (CancelDownInfo_.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        string sendurl    = url.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                        string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                          , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks));

                        HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, sendurl, "", Cookie_, null, null, 180000);

                        if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr" || pResponse.CharacterSet == "EUC-KR")
                        {
                            FileStream fs = File.OpenWrite(downString);

                            string d = pResponse.CharacterSet;
                            Stream responsestream = pResponse.GetResponseStream();
                            byte[] buffer         = new byte[2048];

                            long totalBytesRead = 0;
                            int  bytesRead;

                            while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                            {
                                totalBytesRead += bytesRead;
                                fs.Write(buffer, 0, bytesRead);
                            }
                            fs.Close();
                            fs.Dispose();
                        }

                        CancelDownInfo_.Add(pData.Value.Goods_Code_, downString);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Web_DownLoad_CancelList - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#15
0
        bool GetUseTicketInfo(Int32 goodsSeq, string cpcode, ref string ticketcode)
        {
            ChannelGoodInfo pGoodInfo = GoodsInfoList_[goodsSeq];

            if (pGoodInfo == null)
            {
                string Message = string.Format("GetUseTicketInfo 매칭되는 코드가 없다.{0}/{1}{2}", goodsSeq, cpcode, ticketcode);
                NewLogManager2.Instance.Log(Message);
                return(false);
            }

            DateTime dtNow = DateTime.Now;
            string   eDate = "";

            if (pGoodInfo.eDateFormat_ != null)
            {
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
            }

            string strurl   = LQCrawlerInfo_.UseGoodsUrl_;
            string strparam = LQCrawlerInfo_.UseGoodsParam_;

            string[] cpcodeArray = cpcode.Split('_');
            cpcode   = cpcodeArray[0];
            strparam = strparam.Replace("{CouponCode}", cpcode);
            strparam = strparam.Replace("{sDate}", pGoodInfo.sDate_);
            strparam = strparam.Replace("{eDate}", eDate);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("GET", strurl, strparam, Cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
            string     htmlBuffer = r.ReadToEnd();

            if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseGoodsCheck_) < 0)
            {
                NewLogManager2.Instance.Log(htmlBuffer);
                return(false);
            }

            Regex           re = new Regex(LQCrawlerInfo_.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            MatchCollection oe = re.Matches(htmlBuffer);

            if (oe.Count != 0)
            {
                ticketcode = oe[0].Groups["TicketCode"].ToString();
            }
            else
            {
                return(false);
            }
            return(true);
        }
示例#16
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                DateTime dtNow = DateTime.Now;

                string eDate = "";
                string sDate = "";

                string makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();

                DateTime beforeData = dtNow.AddDays(-7);  // 이지웰 건수가 많으면 데이터를 못들고옴, 10일전 건수만 들고오게 함
                eDate = string.Format("{0:D4}-{1:D2}-{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                sDate = string.Format("{0:D4}-{1:D2}-{2:D2}", beforeData.Year, beforeData.Month, beforeData.Day);

                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                string method = "GET";
                string url    = @"http://partner.weekon.co.kr/pay_info_all/excel";
                string param  = "searchType=all_search&searchText=&mt_sdate=&mt_edate=";

                string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls", makefolder, "C", Convert.ToString(dtNow.Ticks));

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, url, param, Cookie_);

                FileStream fs = File.OpenWrite(downString);

                string d = pResponse.CharacterSet;
                Stream responsestream = pResponse.GetResponseStream();
                byte[] buffer         = new byte[2048];

                long totalBytesRead = 0;
                int  bytesRead;

                while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                {
                    totalBytesRead += bytesRead;
                    fs.Write(buffer, 0, bytesRead);
                }
                fs.Close();
                fs.Dispose();

                CancelDownInfo_.Add("C", downString);
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(ex.Message);
                return(false);
            }

            return(true);
        }
示例#17
0
        public bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                string useurl   = LQCrawlerInfo_.UseUserUrl_;
                string useparam = LQCrawlerInfo_.UseUserParam_;

                string ticketcode = "";
                if (GetUseTicketInfo(cpcode, ref ticketcode) == false)
                {
                    return(false);
                }

                useparam = useparam.Replace("{GoodsCode}", goodscode);
                useparam = useparam.Replace("{TicketCode}", ticketcode);
                useparam = useparam.Replace("{CouponCode}", cpcode);

                if (ticketcode != "")
                {
                    if (ticketcode == "true")
                    {
                        return(true);
                    }


                    HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                    if (pResponse == null)
                    {
                        return(false);
                    }

                    TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                    string     htmlBuffer = r.ReadToEnd();

                    if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                    {
                        NewLogManager2.Instance.Log("사용처리 실패 : " + cpcode);
                        return(false);
                    }
                }
                else
                {
                    NewLogManager2.Instance.Log("cpcode search fail : " + cpcode);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error public override bool Use_Deal - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#18
0
        // 상품 사용 처리 티켓번호 얻어오기
        bool GetUseTicketInfo(Int32 goodsSeq, string cpcode, ref string ticketcode, ref string blackCode)
        {
            try
            {
                ChannelGoodInfo pGoodInfo = GoodsInfoList_[goodsSeq];

                if (pGoodInfo == null)
                {
                    string Message = string.Format("GetUseTicketInfo 매칭되는 코드가 없다.{0}/{1}{2}", goodsSeq, cpcode, ticketcode);
                    NewLogManager2.Instance.Log(Message);
                    return(false);
                }

                DateTime dtNow = DateTime.Now;
                string   eDate = "";
                string   sDate = "";
                if (pGoodInfo.eDateFormat_ != null)
                {
                    eDate = string.Format("{0:D4}{1:D2}{2:D2}", dtNow.Year, dtNow.Month, dtNow.Day);
                    sDate = pGoodInfo.sDate_;
                    sDate = sDate.Replace("-", "");
                }


                string   strurl      = LQCrawlerInfo_.UseUserUrl_;
                string   strparam    = LQCrawlerInfo_.UseUserParam_;
                string[] cpcodeArray = cpcode.Split('_');
                cpcode   = cpcodeArray[0];
                strparam = strparam.Replace("{CouponCode}", cpcode);
                strparam = strparam.Replace("{sDate}", sDate);
                strparam = strparam.Replace("{eDate}", eDate);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", strurl, strparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();
                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error override bool GetUseTicketInfo() - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#19
0
        public override bool Web_DownLoad_CancelList()
        {
            try
            {
                string   method     = "GET";
                string   url        = @"https://wing.coupang.com/refund/approval/exceldown?coupangSrl={GoodsCode}&status=NONE&productTitle=%5B%EB%8C%80%EC%B2%9C%5D+%EC%A7%9A%ED%8A%B8%EB%9E%99+1%EC%9D%B8+%EC%9D%B4%EC%9A%A9%EA%B6%8C&excelDownload=true";
                DateTime dtNow      = DateTime.Now;
                string   makefolder = HKLibrary.UTIL.HKFileHelper.GetCurrentDirectory();
                makefolder += "\\";
                makefolder += CINIManager.Instance.channelseq_;
                makefolder += "\\";
                makefolder += dtNow.ToShortDateString();
                HKLibrary.UTIL.HKFileHelper.MakeFolder(makefolder);

                foreach (var pData in GoodsInfoList_)
                {
                    if (CancelDownInfo_.ContainsKey(pData.Value.Goods_Code_) == false)
                    {
                        string sendurl    = url.Replace("{GoodsCode}", pData.Value.Goods_Code_);
                        string downString = string.Format(@"{0}\Cancel_{1}_{2}.xls"
                                                          , makefolder, pData.Value.Goods_Code_, Convert.ToString(dtNow.Ticks));

                        HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest(method, sendurl, "", Cookie_, null, null, 180000);


                        FileStream fs = File.OpenWrite(downString);

                        string d = pResponse.CharacterSet;
                        Stream responsestream = pResponse.GetResponseStream();
                        byte[] buffer         = new byte[2048];

                        long totalBytesRead = 0;
                        int  bytesRead;

                        while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                        {
                            totalBytesRead += bytesRead;
                            fs.Write(buffer, 0, bytesRead);
                        }
                        fs.Close();
                        fs.Dispose();


                        CancelDownInfo_.Add(pData.Value.Goods_Code_, downString);
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error Web_DownLoad_CancelList {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#20
0
        public override bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                // 웹 호출을 통해서 사용처리한다.
                LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
                string        useurl       = pCrawlerInfo.UseUserUrl_;
                string        useparam     = pCrawlerInfo.UseUserParam_;

                // 두번째 쿠폰 코드 찾기
                Int32  n      = cpcode.IndexOf('-');
                string cp_sub = "";
                if (n < 0)
                {
                    GetUseTicketInfo(cpcode, goodscode, ref cp_sub);
                }
                else
                {
                    cp_sub = cpcode.Substring(n + 1, 9);
                }

                useparam = useparam.Replace("{CouponCode}", cpcode);
                useparam = useparam.Replace("{CouponCode2}", cp_sub);
                useparam = useparam.Replace("{GoodsCode}", goodscode);

                LogManager.Instance.Log(useurl);
                LogManager.Instance.Log(useparam);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(pCrawlerInfo.UseUserCheck_) < 0)
                {
                    LogManager.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                LogManager.Instance.Log(string.Format("사용처리 에러남 {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#21
0
        bool Use_Deal(COrderData pCOrderData)
        {
            try
            {
                string couponcode = pCOrderData.channelOrderCode_;
                Int32  LIndex     = couponcode.LastIndexOf('_');
                couponcode = couponcode.Substring(0, LIndex);
                string delivery_no = "";
                string ticket_code = "";

                DateTime eDateTime = Convert.ToDateTime(pCOrderData.BuyDate_);
                DateTime sDateTime = eDateTime.AddDays(-7);

                string eDate = string.Format("{0:D4}{1:D2}{2:D2}", eDateTime.Year, eDateTime.Month, eDateTime.Day);
                string sDate = string.Format("{0:D4}{1:D2}{2:D2}", sDateTime.Year, sDateTime.Month, sDateTime.Day);

                // 웹 호출을 통해서 사용처리한다.
                string   useurl      = LQCrawlerInfo_.UseUserUrl_;
                string   useparam    = LQCrawlerInfo_.UseUserParam_;
                string[] cpcodeArray = couponcode.Split('_');
                couponcode = cpcodeArray[0];
                GetUseTicketInfo(couponcode, sDate, eDate, ref ticket_code, ref delivery_no);

                useparam = useparam.Replace("{Delivery_no}", delivery_no);
                useparam = useparam.Replace("{GoodsCode}", couponcode);
                useparam = useparam.Replace("{TicketCode}", ticket_code);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Use_Deal(COrderData pCOrderData) - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#22
0
        bool GetUseTicketInfo(string couponcode, string goodscode, ref string ticketcode)
        {
            try
            {
                string[] arrayCoupon;
                arrayCoupon = couponcode.Split('_');

                string strurl   = LQCrawlerInfo_.UseGoodsUrl_;
                string strparam = LQCrawlerInfo_.UseGoodsParam_;
                strparam = strparam.Replace("{CouponCode}", arrayCoupon[0]);
                LQCrawlerInfo_.UseGoodsRule_ = LQCrawlerInfo_.UseGoodsRule_.Replace("{CouponCode}", arrayCoupon[0]);


                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("GET", strurl, strparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseGoodsCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
                htmlBuffer = htmlBuffer.Replace(" ", "&nbsp;");
                Regex           re = new Regex(LQCrawlerInfo_.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(htmlBuffer);


                for (int i = 1; i <= oe.Count; i++)
                {
                    //if (Convert.ToInt32(arrayCoupon[1]) == i)
                    //{
                    ticketcode = oe[i - 1].Groups["TicketCode"].ToString();
                    //}
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool GetUseTicketInfo - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#23
0
        // 상품 사용 처리 티켓번호 얻어오기
        bool GetUseTicketInfo(string couponcode, ref string ticketcode)
        {
            try
            {
                string strurl   = LQCrawlerInfo_.UseGoodsUrl_;
                string strparam = LQCrawlerInfo_.UseGoodsParam_;
                strparam = strparam.Replace("{CouponCode}", couponcode);

                NewLogManager2.Instance.Log(strurl);
                NewLogManager2.Instance.Log(strparam);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", strurl, strparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseGoodsCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
                string          tempCouponCode = "";
                Regex           re             = new Regex(LQCrawlerInfo_.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe             = re.Matches(htmlBuffer);
                for (int i = 0; i < oe.Count; i++)
                {
                    tempCouponCode = oe[i].Groups["CouponCode1"].ToString();
                    tempCouponCode = tempCouponCode + oe[i].Groups["CouponCode2"].ToString();

                    if (tempCouponCode == couponcode)
                    {
                        ticketcode = oe[i].Groups["TicketCode"].ToString();
                    }
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool GetUseTicketInfo - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#24
0
        bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                string useurl   = LQCrawlerInfo_.UseUserUrl_;
                string useparam = LQCrawlerInfo_.UseUserParam_;

                // 두번째 쿠폰 코드 찾기
                string cp_sub = "";
                GetUseTicketInfo(cpcode, goodscode, ref cp_sub);


                string[] arrayCoupon = cpcode.Split('_');

                useparam = useparam.Replace("{CouponCode}", arrayCoupon[1]);
                useparam = useparam.Replace("{CouponCode2}", cp_sub);
                useparam = useparam.Replace("{GoodsCode}", goodscode);


                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_, "",
                                                                            "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
                                                                            , 180000
                                                                            , "application/x-www-form-urlencoded");


                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Use_Deal( 사용처리 에러남 - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#25
0
        bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                string useurl   = LQCrawlerInfo_.UseUserUrl_;
                string useparam = LQCrawlerInfo_.UseUserParam_;

                // 두번째 쿠폰 코드 찾기
                Int32  n      = cpcode.IndexOf('-');
                string cp_sub = "";
                if (n < 0)
                {
                    GetUseTicketInfo(cpcode, goodscode, ref cp_sub);
                }
                else
                {
                    cp_sub = cpcode.Substring(n + 1, 9);
                }

                useparam = useparam.Replace("{CouponCode}", cpcode);
                useparam = useparam.Replace("{CouponCode2}", cp_sub);
                useparam = useparam.Replace("{GoodsCode}", goodscode);
                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0 && htmlBuffer.IndexOf("coupon that was used") < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Use_Deal( 사용처리 에러남 - {0}", ex.Message + "(" + cpcode + ")"));
                return(false);
            }

            return(true);
        }
示例#26
0
        public bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                //string useurl = LQCrawlerInfo_.UseUserUrl_;
                //string useparam = LQCrawlerInfo_.UseUserParam_;

                string useurl   = @"https://withgs.gsshop.com/dlv/mobilCpnAutoRfnManulProc/saveTicktInfo";
                string useparam = @"0_gr_id=0&0_checked=1&0_ordSt=%EB%AF%B8%EC%B2%98%EB%A6%AC&0_exchRtpYn=&0_sordNo=2084278775&0_ordNo={CouponCode}&0_ordItemNo={TicketCode}&0_ordPrsn=%EC%9C%A0%EA%B2%BD%EC%A7%84&0_charCpnRcvCelphn=010****4317&0_charCpnSndCelphn=010****4317&0_cpnPinNoVal=1599-8370&0_cpnNoVal=1599-8370&0_charIssueDt=2014-12-09&0_cpnValidDtm=2015-02-22%2023%3A59%3A59&0_useYn=N&0_custUseDt=&0_relsFshDt=&0_dlvFshDt=&0_saleAwareDt=&0_prdCd=15054184&0_prdNm=%EA%B4%91%EC%A7%84%EA%B5%AC%20%EC%96%B4%EB%A6%B0%EC%9D%B4%ED%9A%8C%EA%B4%80&0_attrPrdCd=15054184001&0_attrPrdNm=&0_intrntPrdNm=%5B%EA%B4%91%EC%A7%84%EA%B5%AC%5D%EC%96%B4%EB%A6%B0%EC%9D%B4%ED%9A%8C%EA%B4%80%20%EB%88%88%EC%8D%B0%EB%A7%A4%EC%9E%A5%20%EB%B9%99%EC%96%B4%EC%9E%A1%EC%9D%B4%EC%B2%B4%ED%97%98%2F%EB%88%88%EB%86%80%EC%9D%B4%EB%8F%99%EC%82%B0%2F%EC%96%B4%EB%A6%B0%EC%9D%B4%EB%8C%80%EA%B3%B5%EC%9B%90%2F%EC%96%B4%EB%A6%84%EC%8D%B0%EB%A7%A4%2F%EA%B2%A8%EC%9A%B8%EB%A0%88%EC%A0%B8%20%EC%B2%B4%ED%97%98&0_sordQty=1&0_supPrdCd=a-12345678910&0_saleTmp=7000&0_supGivAmt=6650&0_autoRfnRt=70&0_smlchgShrRt=50&0_prdRegCpnValidDtm=20150222&0_prdRegCpnValidTerm=&0_!nativeeditor_status=updated&0_noProcCnt=6&0_ordCnlCnt=0&0_dlvFshCnt=0&1_gr_id=1&1_checked=0&1_ordSt=%EB%AF%B8%EC%B2%98%EB%A6%AC&1_exchRtpYn=&1_sordNo=2084278778&1_ordNo=676065839&1_ordItemNo=1&1_ordPrsn=%EC%9C%A0%EA%B2%BD%EC%A7%84&1_charCpnRcvCelphn=010****4317&1_charCpnSndCelphn=010****4317&1_cpnPinNoVal=1599-8370&1_cpnNoVal=1599-8370&1_charIssueDt=2014-12-09&1_cpnValidDtm=2015-02-22%2023%3A59%3A59&1_useYn=N&1_custUseDt=&1_relsFshDt=&1_dlvFshDt=&1_saleAwareDt=&1_prdCd=15054184&1_prdNm=%EA%B4%91%EC%A7%84%EA%B5%AC%20%EC%96%B4%EB%A6%B0%EC%9D%B4%ED%9A%8C%EA%B4%80&1_attrPrdCd=15054184001&1_attrPrdNm=&1_intrntPrdNm=%5B%EA%B4%91%EC%A7%84%EA%B5%AC%5D%EC%96%B4%EB%A6%B0%EC%9D%B4%ED%9A%8C%EA%B4%80%20%EB%88%88%EC%8D%B0%EB%A7%A4%EC%9E%A5%20%EB%B9%99%EC%96%B4%EC%9E%A1%EC%9D%B4%EC%B2%B4%ED%97%98%2F%EB%88%88%EB%86%80%EC%9D%B4%EB%8F%99%EC%82%B0%2F%EC%96%B4%EB%A6%B0%EC%9D%B4%EB%8C%80%EA%B3%B5%EC%9B%90%2F%EC%96%B4%EB%A6%84%EC%8D%B0%EB%A7%A4%2F%EA%B2%A8%EC%9A%B8%EB%A0%88%EC%A0%B8%20%EC%B2%B4%ED%97%98&1_sordQty=1&1_supPrdCd=a-12345678910&1_saleTmp=7000&1_supGivAmt=6650&1_autoRfnRt=70&1_smlchgShrRt=50&1_prdRegCpnValidDtm=20150222&1_prdRegCpnValidTerm=&1_!nativeeditor_status=updated&1_noProcCnt=6&1_ordCnlCnt=0&1_dlvFshCnt=0&ids=0%2C1";

                string ticketcode = "";
                if (GetUseTicketInfo(cpcode, ref ticketcode) == false)
                {
                    return(false);
                }

                useparam = useparam.Replace("{GoodsCode}", goodscode);
                useparam = useparam.Replace("{TicketCode}", ticketcode);
                useparam = useparam.Replace("{CouponCode}", cpcode);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error public override bool Use_Deal - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#27
0
        bool GetUseTicketInfo(string couponcode, string goodscode, ref string ticketcode)
        {
            try
            {
                string[] arrayCoupon;
                arrayCoupon = couponcode.Split('_');

                string strurl   = LQCrawlerInfo_.UseGoodsUrl_;
                string strparam = LQCrawlerInfo_.UseGoodsParam_;
                strparam = strparam.Replace("{CouponCode}", arrayCoupon[0]);


                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("GET", strurl, strparam, Cookie_, "",
                                                                            "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
                                                                            , 180000
                                                                            , "application/x-www-form-urlencoded");

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseGoodsCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }

                Regex           re = new Regex(LQCrawlerInfo_.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(htmlBuffer);

                ticketcode = oe[0].Groups["TicketCode"].ToString();
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool GetUseTicketInfo - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#28
0
        bool DownRefundList(string downfile, string goodscode)
        {
            // 웹 호출을 통해서 사용처리한다.
            LQCrawlerInfo pCrawlerInfo = CrawlerManager.Instance.GetCrawlerInfo();
            string        useurl       = @"http://biz.wemakeprice.com/dealer/deal_list/do_xsl_download/{GoodsCode}/1";
            string        useparam     = "";

            useparam = useparam.Replace("{GoodsCode}", goodscode);

            HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("GET", useurl, useparam, cookie_);

            if (pResponse == null)
            {
                return(false);
            }

            if (pResponse.CharacterSet == "" || pResponse.CharacterSet == "euc-kr")
            {
                FileStream fs = File.OpenWrite(downfile);

                string d = pResponse.CharacterSet;
                Stream responsestream = pResponse.GetResponseStream();
                byte[] buffer         = new byte[2048];

                long totalBytesRead = 0;
                int  bytesRead;

                while ((bytesRead = responsestream.Read(buffer, 0, buffer.Length)) > 0)
                {
                    totalBytesRead += bytesRead;
                    fs.Write(buffer, 0, bytesRead);
                }
                fs.Close();
            }
            else
            {
                TextReader textReader = (TextReader) new StreamReader(pResponse.GetResponseStream(), Encoding.GetEncoding(pResponse.CharacterSet));
                string     htmlBuffer = textReader.ReadToEnd();
                HKLibrary.UTIL.HKFileHelper.SaveToFile(downfile, htmlBuffer);
            }

            return(true);
        }
示例#29
0
        bool GetUseTicketInfo(string couponcode, string sDate, string geDate, ref string ticketcode, ref string delivery_no)
        {
            try
            {
                string strurl   = LQCrawlerInfo_.UseGoodsUrl_;
                string strparam = LQCrawlerInfo_.UseGoodsParam_;
                strparam = strparam.Replace("{CouponCode}", couponcode);
                strparam = strparam.Replace("{sDate}", sDate);
                strparam = strparam.Replace("{eDate}", geDate);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", strurl, strparam, Cookie_);

                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseGoodsCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }

                htmlBuffer = htmlBuffer.Replace(" ", "&nbsp");
                htmlBuffer = htmlBuffer.Replace(" ", "&nbsp");

                Regex           re = new Regex(LQCrawlerInfo_.UseGoodsRule_, RegexOptions.IgnoreCase | RegexOptions.Singleline);
                MatchCollection oe = re.Matches(htmlBuffer);

                ticketcode  = oe[0].Groups["TicketCode"].ToString();
                delivery_no = oe[0].Groups["Delivery_no"].ToString();
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool GetUseTicketInfo - {0}", ex.Message));
                return(false);
            }

            return(true);
        }
示例#30
0
        bool Use_Deal(Int32 goodsSeq, string cpcode, string goodscode)
        {
            try
            {
                string useurl   = LQCrawlerInfo_.UseUserUrl_;
                string useparam = LQCrawlerInfo_.UseUserParam_;

                // 두번째 쿠폰 코드 찾기
                string cp_sub = "";
                GetUseTicketInfo(cpcode, goodscode, ref cp_sub);


                string[] arrayCoupon = cpcode.Split('_');

                useparam = useparam.Replace("{TicketCode}", cp_sub);

                HttpWebResponse pResponse = HKHttpWebRequest.ReqHttpRequest("POST", useurl, useparam, Cookie_);


                if (pResponse == null)
                {
                    return(false);
                }

                TextReader r          = (TextReader) new StreamReader(pResponse.GetResponseStream());
                string     htmlBuffer = r.ReadToEnd();

                if (htmlBuffer.IndexOf(LQCrawlerInfo_.UseUserCheck_) < 0)
                {
                    NewLogManager2.Instance.Log(htmlBuffer);
                    return(false);
                }
            }
            catch (System.Exception ex)
            {
                NewLogManager2.Instance.Log(string.Format("Error bool Use_Deal( 사용처리 에러남 - {0}", ex.Message));
                return(false);
            }

            return(true);
        }