public static void zhuanhua_copy_Click_kouling(CmsForm cmsForm, string content) { try { content = UrlUtil.copyImgContent(cmsForm, content, null); content = UrlUtil.parseContentWenan(cmsForm, content); ContentItem contentItem = UrlUtil.parseContent(cmsForm, content, null, true, true, 0); content = contentItem.content_send; string qq_com_pid = PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id); string weiba = UrlUtil.parseContent_kouling(cmsForm, contentItem, PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id), true); if (!string.IsNullOrEmpty(weiba)) { content = content + weiba; } string out_log; QqUtil.copy_content(cmsForm, content, out out_log); if (cmsForm.checkBox_tools_qingkong.Checked) { ((IHTMLDocument2)cmsForm.webBrowser_zhuanhua.Document.DomDocument).body.innerHTML = ""; } LogUtil.log_call(cmsForm, "转换拷贝完成!"); } catch (Exception exception) { //MessageBox.Show("[messageForThread]出错:" + exception.ToString()); } }
public static CouponContent parseContent(CmsForm cmsForm, string content, string qun_pid) { CouponContent couponContent = new CouponContent(); couponContent.content = content; couponContent.memo = TaobaoUtil.toText(content); UrlParse.parseContentUrlList(couponContent, cmsForm, content); if (!string.IsNullOrEmpty(couponContent.num_iid)) { string out_log = ""; int hours = 1; try { hours = int.Parse(cmsForm.textBox_qunfa_times.Text.Trim()); } catch (Exception) { } ArrayList arrayList = cmsForm.sendSqlUtil.query_send_item(couponContent.num_iid, hours, out out_log); if (arrayList.Count > 0) { couponContent.status = 4; return(couponContent); } if (!string.IsNullOrEmpty(PidUtil.get_qq_com_pid_call(cmsForm, null))) { qun_pid = PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id); } else if (!string.IsNullOrEmpty(PidUtil.get_qq_queqiao_pid_call(cmsForm, null))) { qun_pid = PidUtil.get_qq_queqiao_pid_call(cmsForm, cmsForm.appBean.member_id); } else if (!string.IsNullOrEmpty(PidUtil.get_weixin_pid_call(cmsForm, null))) { qun_pid = PidUtil.get_weixin_pid_call(cmsForm, cmsForm.appBean.member_id); } if (!string.IsNullOrEmpty(qun_pid)) { ShareItem shareItem = UrlParse.query_share(cmsForm, couponContent.num_iid, qun_pid); if (shareItem != null) { couponContent.coupon_money = shareItem.coupon_money; couponContent.price = shareItem.price; } else { couponContent.status = 1; return(couponContent); } } } return(couponContent); }
public static string get_kouling_call(CmsForm cmsForm, string uland_url, string pic, string text, string ext) { string _kouling; try { if (!cmsForm.textBox_setting_appId.InvokeRequired) { _kouling = PidUtil.get_kouling(cmsForm, uland_url, pic, text, ext); } else { get_kouling getKouling = new get_kouling(PidUtil.get_kouling); object[] objArray = new object[] { cmsForm, uland_url, pic, text, ext }; _kouling = (string)cmsForm.Invoke(getKouling, objArray); } } catch (Exception exception) { return(""); } return(_kouling); }
public static string get_weibo_pid_call(CmsForm cmsForm, string member_id) { string weixinPid; try { if (!cmsForm.comboBox_weibo_tongyong_danyuan.InvokeRequired) { weixinPid = PidUtil.get_weibo_pid(cmsForm, member_id); } else { get_pid getPid = new get_pid(PidUtil.get_weibo_pid); object[] objArray = new object[] { cmsForm, member_id }; weixinPid = (string)cmsForm.Invoke(getPid, objArray); } } catch (Exception exception) { return(""); } return(weixinPid); }
public static void qunfa_shoudong_fasong(CmsForm cmsForm, string content) { try { content = UrlUtil.parseContentWenan(cmsForm, content); ContentItem contentItem = UrlUtil.parseContent(cmsForm, content, null, cmsForm.checkBox_qunfa_pid.Checked, true, 0); if ((contentItem.urlList == null || contentItem.urlList.Count == 0) && cmsForm.checkBox_qunfa_link.Checked) { LogUtil.log_call(cmsForm, "没有连接,跳过发送!"); ((IHTMLDocument2)cmsForm.webBrowser_send_content.Document.DomDocument).body.innerHTML = ""; return; } if (contentItem.status < 1) { if (cmsForm.checkBox_qunfa_qq_boolean.Checked) //开启了qq发送 { LogUtil.log_call(cmsForm, "开始qq群的发送!"); string content_send = contentItem.content_send; content_send = UrlUtil.template_qq(cmsForm, contentItem, PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id), cmsForm.checkBox_qunfa_pid.Checked, cmsForm.appBean.qq_template); content_send = UrlUtil.copyImgContent(cmsForm, content_send, null); //if (this.checkBox_qunfa_qq_kouling_boolean.Checked == true) //{ // string kouling = UrlUtil.parseContent_kouling(this, contentItem, PidUtil.get_qq_com_pid(this, this.appBean.member_id), true); // content_send = content_send + kouling; //} QqUtil.send(cmsForm, content_send, content, contentItem.url_type, 1); //QqUtil.send(this, contentItem.content_send); } if (cmsForm.checkBox_qunfa_weixin_boolean.Checked) //开启了qq发送 { UrlUtil.parseContent_weixin(cmsForm, contentItem, null, cmsForm.checkBox_qunfa_pid.Checked); UrlUtil.template_qq(cmsForm, contentItem, PidUtil.get_weixin_pid_call(cmsForm, cmsForm.appBean.member_id), cmsForm.checkBox_qunfa_pid.Checked, cmsForm.appBean.weixin_template); LogUtil.log_call(cmsForm, "开始微信群的发送!"); WeixinUtil.send(cmsForm, contentItem.content_weixin, contentItem.content_weixin_img, contentItem.imgList, content, contentItem.url_type, 1); } if (cmsForm.checkBox_qunfa_weibo_boolean.Checked) //开启了qq发送 { UrlUtil.parseContent_weixin(cmsForm, contentItem, PidUtil.get_weibo_pid_call(cmsForm, cmsForm.appBean.member_id), cmsForm.checkBox_qunfa_pid.Checked); UrlUtil.template_qq(cmsForm, contentItem, PidUtil.get_weibo_pid_call(cmsForm, cmsForm.appBean.member_id), cmsForm.checkBox_qunfa_pid.Checked, cmsForm.appBean.weibo_template); LogUtil.log_call(cmsForm, "开始微博的发送!"); WeiboUtil.send(cmsForm, contentItem.content_weixin, contentItem.content_weixin_img, contentItem.imgList, content, contentItem.url_type, 1); } } else if (contentItem.status == 1) { LogUtil.log_call(cmsForm, "优惠券小于最低优惠券要求,跳过发送!"); } else if (contentItem.status == 2) { LogUtil.log_call(cmsForm, "佣金比例小于设置的最低比例,跳过发送!"); } else if (contentItem.status == 2) { LogUtil.log_call(cmsForm, "所发的链接转换失败,跳过发送!"); } try { ((IHTMLDocument2)cmsForm.webBrowser_send_content.Document.DomDocument).body.innerHTML = ""; } catch (Exception exception) { } } catch (Exception exception) { LogUtil.log_call(cmsForm, "发动异常:" + exception.ToString()); //MessageBox.Show("[messageForThread]出错:" + exception.ToString()); } }
public static UrlItem pareUrl(ContentItem contentItem, CmsForm cmsForm, UrlItem urlItem, string qun_pid, bool zhuan_pid_boolean, int count, bool apply_jihua, int url_type) { string url = urlItem.ori_url; //LogUtil.log_call(cmsForm, string.Concat("url:", url)); if (count > 0 && !string.IsNullOrEmpty(urlItem.url)) { url = urlItem.url; } if (count > 2) { return(urlItem); } if (contentItem.status > 0) { return(urlItem); } try { int qunfa_coupon = 0; int qunfa_commission = 0; try { qunfa_coupon = int.Parse(cmsForm.textBox_qunfa_coupon.Text.Trim()); qunfa_commission = int.Parse(cmsForm.textBox_qunfa_commission.Text.Trim()); } catch (Exception) { } string pid = null; if (!string.IsNullOrEmpty(qun_pid)) { pid = qun_pid; } else { if (!string.IsNullOrEmpty(PidUtil.get_qq_com_pid_call(cmsForm, null))) { pid = PidUtil.get_qq_com_pid_call(cmsForm, cmsForm.appBean.member_id); } else if (!string.IsNullOrEmpty(PidUtil.get_qq_queqiao_pid_call(cmsForm, null))) { pid = PidUtil.get_qq_queqiao_pid_call(cmsForm, cmsForm.appBean.member_id); } else if (!string.IsNullOrEmpty(PidUtil.get_weixin_pid_call(cmsForm, null))) { pid = PidUtil.get_weixin_pid_call(cmsForm, cmsForm.appBean.member_id); } } LogUtil.log_call(cmsForm, string.Concat("pid:", pid)); int click_status = 0; if ((( url.Contains("shaquanquan.com") //|| url.Contains("tmall.com") //|| url.Contains("yao.95095.com") ) //&& url.Contains("item.htm") && url.Contains("id=") )) { LogUtil.log_call(cmsForm, string.Concat("产品链接:", url)); urlItem.url_type = 5; urlItem.url = url; urlItem.num_iid = TaobaoUtil.get_product_id(url); //LogUtil.log_call(cmsForm, string.Concat("id:", StringUtil.subString(url, 0, "id=", "&"))); //UrlUtil.remove_ali(urlItem); int hours = cmsForm.appBean.qunfa_hours; string out_log; ArrayList arrayList = cmsForm.sendSqlUtil.query_send_item(urlItem.num_iid, hours, out out_log); if (arrayList.Count > 0) { contentItem.status = 4; return(urlItem); } //LogUtil.log_call(cmsForm, ":" + urlItem.num_iid); string click_url = ApiUtil.apply_taoke_url_item(cmsForm, contentItem, urlItem, urlItem.num_iid, pid); urlItem.click_url = click_url; //if (string.IsNullOrEmpty(urlItem.click_url)) if (click_status == 2) { contentItem.status = 2; return(urlItem); } } else { if (count > 0) { LogUtil.log_call(cmsForm, string.Concat("一般链接(无需转换):", url)); urlItem.url_type = 0; urlItem.url = url; } else { string str = TaobaoUtil.get_redirect_url(url, url); urlItem.url = str; UrlHptUtil.pareUrl(contentItem, cmsForm, urlItem, qun_pid, zhuan_pid_boolean, count + 1, apply_jihua, url_type); } } } catch (Exception exception1) { Exception exception = exception1; if (!exception.ToString().Contains("System.Net.WebException")) { LogUtil.log_call(cmsForm, string.Concat("[changeUrl]出错!需要转换的链接:【", url, "】,", exception.ToString())); } else { LogUtil.log_call(cmsForm, string.Concat("[changeUrl]出错,估计是一时网络问题,也可能是短网址问题,一般重试即可解决问题,需要转换的链接:【", url, "】,")); } UrlHptUtil.pareUrl(contentItem, cmsForm, urlItem, qun_pid, zhuan_pid_boolean, count + 1, apply_jihua, url_type); } return(urlItem); }