public static void tools_zhuanhua_tianjia_zhushou(CmsForm cmsForm, string content1) { try { SendItem sendItem = new SendItem(); sendItem.from = "手工添加"; sendItem.create_date_str = DateTime.Now.ToString("yyyyMMddHHmmssfff"); string content = cmsForm.webBrowser_zhuanhua.Document.Body.InnerHtml; if (string.IsNullOrEmpty(content)) { LogUtil.log_call(cmsForm, "跟发内容不能为空!"); return; } content = UrlUtil.parseContentWenan(cmsForm, content); ContentItem contentItem = UrlUtil.parseContent(cmsForm, content, null, cmsForm.checkBox_qunfa_pid.Checked, true, 0); content = contentItem.content_send; if (!string.IsNullOrEmpty(content)) { content = UrlUtil.copyImgContent(cmsForm, content, sendItem.create_date_str); sendItem.memo = CommonUtil.toText(content); string follow_path = cmsForm.appBean.follow_path + @"\" + sendItem.create_date_str; if (!Directory.Exists(follow_path)) { Directory.CreateDirectory(follow_path); } UtilFile.write(string.Concat(follow_path, "\\content.html"), content, Encoding.GetEncoding("GB2312")); ((IHTMLDocument2)cmsForm.webBrowser_zhuanhua.Document.DomDocument).body.innerHTML = ""; LogUtil.log_call(cmsForm, "添加跟发成功!"); string out_log = ""; cmsForm.sendSqlUtil.insert(sendItem, out out_log); //cmsForm.load_follow(out out_log); FollowUtil.load_call(cmsForm); } else { LogUtil.log_call(cmsForm, "跟发内容不能为空!"); } if (cmsForm.checkBox_tools_qingkong.Checked) { ((IHTMLDocument2)cmsForm.webBrowser_zhuanhua.Document.DomDocument).body.innerHTML = ""; } } catch (Exception exception) { //MessageBox.Show("[messageForThread]出错:" + exception.ToString()); } }
public static void load_pid_call(CmsForm cmsForm, int qun_type) { try { if (cmsForm.dataGridView_fenqun_qq.InvokeRequired) { load_qun_pid method = new load_qun_pid(FollowUtil.load_pid_call); cmsForm.BeginInvoke(method, new object[] { cmsForm, qun_type }); } else { FollowUtil.load_pid(cmsForm, qun_type); } } catch (Exception exception) { MessageBox.Show("[load_pid_qq]出错:" + exception.ToString()); } }
public static void load_weibo_call(CmsForm cmsForm) { try { if (cmsForm.dataGridView_weibo.InvokeRequired) { load method = new load(FollowUtil.load_weibo_call); cmsForm.BeginInvoke(method, new object[] { cmsForm }); } else { FollowUtil.load_weibo(cmsForm); } } catch (Exception exception) { MessageBox.Show("[load_weibo]出错:" + exception.ToString()); } }
public static void qunfa_shoudong_gengfa(CmsForm cmsForm, string content1) { try { SendItem sendItem = new SendItem(); sendItem.from = "手工添加"; sendItem.create_date_str = DateTime.Now.ToString("yyyyMMddHHmmssfff"); string content = cmsForm.webBrowser_send_content.Document.Body.InnerHtml; //ContentItem contentItem = UrlUtil.parseContent(this,content); //sendItem.num_iid = contentItem.num_iid; if (!string.IsNullOrEmpty(content)) { content = UrlUtil.copyImgContent(cmsForm, content, sendItem.create_date_str); sendItem.memo = CommonUtil.toText(content); string follow_path = cmsForm.appBean.follow_path + @"\" + sendItem.create_date_str; if (!Directory.Exists(follow_path)) { Directory.CreateDirectory(follow_path); } UtilFile.write(string.Concat(follow_path, "\\content_wenan.html"), UrlUtil.parseContentWenan(cmsForm, content), Encoding.GetEncoding("GB2312")); UtilFile.write(string.Concat(follow_path, "\\content_img.html"), UrlUtil.parseImg(cmsForm, content), Encoding.GetEncoding("GB2312")); UtilFile.write(string.Concat(follow_path, "\\content.html"), content, Encoding.GetEncoding("GB2312")); ((IHTMLDocument2)cmsForm.webBrowser_send_content.Document.DomDocument).body.innerHTML = ""; LogUtil.log_call(cmsForm, "添加跟发成功!"); string out_log = ""; cmsForm.sendSqlUtil.insert(sendItem, out out_log); FollowUtil.load_call(cmsForm); } else { LogUtil.log_call(cmsForm, "跟发内容不能为空!"); } } catch (Exception exception) { //MessageBox.Show("[messageForThread]出错:" + exception.ToString()); } }
public static void sendGroup(CmsForm cmsForm, string content_json) { if (!cmsForm.appBean.gengfa_qun) { return; } if (cmsForm.appBean.qunfa_genfa_status == false) { return; } JsonData sync_resul = JsonMapper.ToObject(content_json) as JsonData; string content = sync_resul["content"].ToString(); string group = sync_resul["group"].ToString(); string qq = sync_resul["qq"].ToString(); ArrayList textBox_qun_list = QQqunUtil.findGroup(cmsForm); ArrayList textBox_qun_guolv = QQqunUtil.findGroup_guolv(cmsForm); ArrayList textBox_qun_del = QQqunUtil.findGroup_del(cmsForm); string sbf = ""; if (textBox_qun_list.Contains(group)) { if (!string.IsNullOrEmpty(content)) { string[] sArray = Regex.Split(content, "\n", RegexOptions.IgnoreCase); foreach (string i in sArray) { if (QQqunUtil.isContains(textBox_qun_del, i)) { break; } if (QQqunUtil.isContains(textBox_qun_guolv, i)) { continue; } sbf = sbf + i; } } LogUtil.log_qun_call(cmsForm, "content:" + content); if (!string.IsNullOrEmpty(sbf)) { SendItem sendItem = new SendItem(); sendItem.from = "群:" + group; sendItem.create_date_str = DateTime.Now.ToString("yyyyMMddHHmmssfff"); content = sbf; content = QQqunUtil.parseContentWenan(cmsForm, content); if (!string.IsNullOrEmpty(content)) { //content = UrlUtil.copyImgContent(this, content, sendItem.create_date_str); sendItem.memo = CommonUtil.toText(content); FollowUtil.load_item(cmsForm, sendItem); string follow_path = cmsForm.appBean.follow_path + @"\" + sendItem.create_date_str; if (!Directory.Exists(follow_path)) { Directory.CreateDirectory(follow_path); } //UtilFile.write(string.Concat(follow_path, "\\content_wenan.html"), UrlUtil.parseContentWenan(this, content), Encoding.GetEncoding("GB2312")); //UtilFile.write(string.Concat(follow_path, "\\content_img.html"), UrlUtil.parseImg(this, content), Encoding.GetEncoding("GB2312")); UtilFile.write(string.Concat(follow_path, "\\content.html"), content, Encoding.GetEncoding("GB2312")); //((IHTMLDocument2)this.webBrowser_send_content.Document.DomDocument).body.innerHTML = ""; //LogUtil.log_call(this,"---------------------"); string out_log; cmsForm.sendSqlUtil.insert(sendItem, out out_log); //LogUtil.log_call(this, "-----------out_log----------" + out_log); } //FollowUtil.load_call(cmsForm); } } }