基本信息
源码名称:微信多开多账号机器人 云客服系统 微商营销 系统web协议一键登录
源码大小:38.76M
文件格式:.zip
开发语言:C#
更新时间:2017-08-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 5 元×
微信扫码支付:5 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
}
微信多开多账号机器人 云客服系统 微商营销 系统web协议一键登录
-
微信网页版本协议多开
-
一键登录
-
红包数量提醒
-
wx用户识别男女签名备注,群发
-
自动发消息 定时发消息 群消息监控
-
机器人回复 ,定时回复,超时回复
-
聊天记录保存,聊天记录查看
| public class HttpService |
| { |
| /// <summary> |
| /// cookie容器 |
| /// </summary> |
| public static Dictionary<string, CookieContainer> CookiesContainerDic = new Dictionary<string, CookieContainer>(); |
|
|
|
|
| public static byte[] SendGetRequest(string url, string uid) |
| { |
| try |
| { |
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| request.Method = "get"; |
|
|
| if (!string.IsNullOrEmpty(uid)) |
| { |
| CookieContainer _cookiesContainer = CookiesContainerDic[uid]; |
|
|
| if (_cookiesContainer == null) |
| { |
| _cookiesContainer = new CookieContainer(); |
| } |
| if (!CookiesContainerDic.ContainsKey(uid)) |
| { |
| CookiesContainerDic.Add(uid, _cookiesContainer); |
| } |
|
|
| request.CookieContainer = _cookiesContainer; //启用cookie |
| } |
|
|
| HttpWebResponse response = (HttpWebResponse)request.GetResponse(); |
| Stream response_stream = response.GetResponseStream(); |
|
|
| int count = (int)response.ContentLength; |
| int offset = 0; |
| byte[] buf = new byte[count]; |
| while (count > 0) //读取返回数据 |
| { |
| int n = response_stream.Read(buf, offset, count); |
| if (n == 0) break; |
| count -= n; |
| offset = n; |
| } |
| return buf; |
| } |
| catch (Exception ex) |
| { |
| MessageBox.Show(ex.Message); |
| return null; |
| } |
| } |
|
|
| /// <summary> |
| /// get请求,并返回cookie |
| /// </summary> |
| /// <param name="url"></param> |
| /// <param name="cookieContainer"></param> |
| /// <returns></returns> |
| public static byte[] SendGetRequest(string url, ref CookieContainer cookieContainer) |
| { |
| try |
| { |
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| request.Method = "get"; |
| request.CookieContainer = cookieContainer; //启用cookie |
|
|
| HttpWebResponse response = (HttpWebResponse)request.GetResponse(); |
| Stream response_stream = response.GetResponseStream(); |
|
|
| int count = (int)response.ContentLength; |
| int offset = 0; |
| byte[] buf = new byte[count]; |
| while (count > 0) //读取返回数据 |
| { |
| int n = response_stream.Read(buf, offset, count); |
| if (n == 0) break; |
| count -= n; |
| offset = n; |
| } |
| return buf; |
| } |
| catch (Exception ex) |
| { |
| MessageBox.Show(ex.Message); |
| return null; |
| } |
| } |
|
|
| public static byte[] SendPostRequest(string url, string body, string uid) |
| { |
| try |
| { |
| byte[] request_body = Encoding.UTF8.GetBytes(body); |
|
|
| HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| request.Method = "post"; |
| request.ContentLength = request_body.Length; |
|
|
| Stream request_stream = request.GetRequestStream(); |
|
|
| request_stream.Write(request_body, 0, request_body.Length); |
|
|
| if (!string.IsNullOrEmpty(uid)) |
| { |
| CookieContainer _cookiesContainer = null; |
| if (CookiesContainerDic.ContainsKey(uid)) |
| { |
| _cookiesContainer = CookiesContainerDic[uid]; |
| } |
|
|
| if (_cookiesContainer == null) |
| { |
| _cookiesContainer = new CookieContainer(); |
| } |
| if (!CookiesContainerDic.ContainsKey(uid)) |
| { |
| CookiesContainerDic.Add(uid, _cookiesContainer); |
| } |
|
|
| request.CookieContainer = _cookiesContainer; //启用cookie |
| } |
|
|
|
|
| HttpWebResponse response = (HttpWebResponse)request.GetResponse(); |
| Stream response_stream = response.GetResponseStream(); |
|
|
| int count = (int)response.ContentLength; |
| int offset = 0; |
| byte[] buf = new byte[count]; |
| while (count > 0) //读取返回数据 |
| { |
| int n = response_stream.Read(buf, offset, count); |
| if (n == 0) break; |
| count -= n; |
| offset = n; |
| } |
| return buf; |
| } |
| catch |
| { |
| return null; |
| } |