|

楼主 |
发表于 2016-6-25 16:52:48
|
显示全部楼层
山东省潍坊市
.版本 2
.支持库 json
.子程序 SendMsg, 逻辑型, 公开, 发送消息
.参数 Msg, 文本型
.参数 tousername, 文本型
.局部变量 https, WinHttp
.局部变量 Content, 文本型
.局部变量 time, 文本型
.局部变量 Str, 文本型
.局部变量 json, JSON
.局部变量 json1, JSON
deviceid = “e” + Strin.RandomInt (15)
time = Strin.TimeStamp () + Strin.RandomInt (4)
json.解析 (“”)
json1.解析 (“”)
json1.置属性 (“Uin”, 到长整数 (wxuin))
json1.置属性 (“Sid”, wxsid)
json1.置属性 (“Skey”, Skey)
json1.置属性 (“DeviceID”, deviceid)
json.置属性 (“BaseRequest”, json1)
json1.解析 (“”)
json1.置属性 (“Type”, 1)
json1.置属性 (“Content”, Msg)
json1.置属性 (“FromUserName”, UserName)
json1.置属性 (“ToUserName”, tousername)
json1.置属性 (“LocalID”, time)
json1.置属性 (“ClientMsgId”, time)
json.置属性 (“Msg”, json1)
Content = json.到文本 ()
https.FillHeader (假)
https.Open (“POST”, “https://” + DomainName + “/cgi-bin/mmwebwx-bin/webwxsendmsg?lang=zh_CN&pass_ticket=” + pass_ticket)
https.SetRequestHeader (“Content-Type”, “application/json; charset=utf-8”)
https.SetRequestHeader (“Accept”, “application/json, text/plain, */*”)
https.SetRequestHeader (“User-Agent”, “Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0”)
https.SetRequestHeader (“Referer”, “https://” + DomainName + “/cgi-bin/mmwebwx-bin/webwxindex?t=v2”)
https.SetRequestHeader (“Cookie”, Cookie)
https.Send (Ecode.GB2312ToUtf8 (Content))
Coke.Merge (Cookie, https.GetResponseCookie ())
Str = https.GetResponseText ()
json.解析 (Str)
.如果真 (到整数 (json.取属性 (“BaseRequest”).取通用属性 (“Ret”)) = 0)
返回 (真)
.如果真结束
返回 (假)
|
|