WPF 微信 MVVM 【续】修复部分用户无法获取列表
看过我WPF 微信 MVVM这篇文章的朋友,应该知道我里面提到了我有一个小号是无法获取列表的,始终也没找到原因。
前两天经过GitHub上h4dex大神的指导,知道了原因,是因为微信在登录以后,web微信采取了不同的域名来兼容各种用户。
下面是大神提供的js代码和C#代码
function ()
{
var e = location.host,
t = 'weixin.qq.com',
o = 'file.wx.qq.com',
n = 'webpush.weixin.qq.com';
e.indexOf('wx2.qq.com') > - 1 ? (t = 'weixin.qq.com', o = 'file2.wx.qq.com', n = 'webpush2.weixin.qq.com')
: e.indexOf('qq.com') > - 1 ? (t = 'weixin.qq.com', o = 'file.wx.qq.com', n = 'webpush.weixin.qq.com')
: e.indexOf('web1.wechat.com') > - 1 ? (t = 'wechat.com', o = 'file1.wechat.com', n = 'webpush1.wechat.com')
: e.indexOf('web2.wechat.com') > - 1 ? (t = 'wechat.com', o = 'file2.wechat.com', n = 'webpush2.wechat.com')
: e.indexOf('wechat.com') > - 1 ? (t = 'wechat.com', o = 'file.wechat.com', n = 'webpush.wechat.com')
: e.indexOf('web1.wechatapp.com') > - 1 ? (t = 'wechatapp.com', o = 'file1.wechatapp.com', n = 'webpush1.wechatapp.com')
: (t = 'wechatapp.com', o = 'file.wechatapp.com', n = 'webpush.wechatapp.com');
}
js
public object LoginCheck()
{
if(this.string_0 != null)
{
string[] strArray = new string[];
strArray[] = this.string_7;
strArray[] = this.string_0;
strArray[] = "&tip=0&r=";
TimeSpan span = (TimeSpan)(DateTime.Now.ToUniversalTime() - new DateTime(0x7b2, , ));
long totalMilliseconds = (long) span.TotalMilliseconds;
strArray[] = totalMilliseconds.ToString();
strArray[] = "&_=";
span = (TimeSpan)(DateTime.Now.ToUniversalTime() - new DateTime(0x7b2, , ));
strArray[] = ((long) span.TotalMilliseconds).ToString();
byte[] bytes = this.httpService_0.SendGetRequest(string.Concat(strArray));
string str2 = Encoding.UTF8.GetString(bytes);
if(str2.Contains("=201"))
{
string s = str2.Split(new string[] { "'" }, StringSplitOptions.None)[].Split(new char[] { ',' })[];
byte[] buffer = Convert.FromBase64String(s);
MemoryStream stream = new MemoryStream(buffer, , buffer.Length);
stream.Write(buffer, , buffer.Length);
return Image.FromStream(stream);
}
if(str2.Contains("=200"))
{
string str3 = str2.Split(new string[] { "\"" }, StringSplitOptions.None)[];
string domain = CheckData.Getdomain(str3);
if(domain.IndexOf("wx2.qq.com") > -)
{
this.string_1 = "https://wx2.qq.com/";
this.string_2 = "https://wx2.qq.com";
this.string_4 = "https://file2.wx.qq.com";
this.string_3 = "https://webpush2.weixin.qq.com";
return str3;
}
if(domain.IndexOf("qq.com") > -)
{
this.string_2 = "https://wx.qq.com";
this.string_4 = "https://file.wx.qq.com";
this.string_3 = "https://webpush.weixin.qq.com";
return str3;
}
if(domain.IndexOf("web1.wechat.com") > -)
{
this.string_2 = "https://web.wechat.com";
this.string_4 = "https://file1.wechat.com";
this.string_3 = "https://webpush1.wechat.com";
return str3;
}
if(domain.IndexOf("web2.wechat.com") > -)
{
this.string_2 = "https://web.wechat.com";
this.string_4 = "https://file2.wechat.com";
this.string_3 = "https://webpush2.wechat.com";
return str3;
}
if(domain.IndexOf("wechat.com") > -)
{
this.string_2 = "https://web.wechat.com";
this.string_4 = "https://file.wechat.com";
this.string_3 = "https://webpush.wechat.com";
return str3;
}
if(domain.IndexOf("web1.wechatapp.com") > -)
{
this.string_2 = "https://web.wechatapp.com";
this.string_4 = "https://file1.wechatapp.com";
this.string_3 = "https://webpush1.wechatapp.com";
return str3;
}
this.string_2 = "https://web.wechatapp.com";
this.string_4 = "https://file.wechatapp.com";
this.string_3 = "https://webpush.wechatapp.com";
return str3;
}
}
return null;
}
C#
根据其方法,我进行了修改,可以实现登录以后的后续操作了。
如图,就是小号登录以后,可以获取列表了


修改后的代码已上传GitHub
WPF 微信 MVVM 【续】修复部分用户无法获取列表的更多相关文章
- WPF 微信 MVVM 【续】发送部分QQ表情
今天主要记录的就是发送QQ表情, WPF 微信 MVVM里写了,后期为了发送QQ表情,需要把TextBox替换为RichTextBox,接下来就说说替换的过程. 一.支持Binding的RichTex ...
- WPF 微信 MVVM
公司的同事离职了,接下来的日子可能会忙碌,能完善DEMO的时间也会少了,因此,把做的简易DEMO整体先记录一下,等后续不断的完善. 参考两位大神的日志:WEB版微信协议部分功能分析.[完全开源]微信客 ...
- JAVA微信公众号网页开发 —— 用户授权获取openid
官方文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842 HttpClientUtil.java packa ...
- WPF Prism MVVM 中 弹出新窗体. 放入用户控件
原文:WPF Prism MVVM 中 弹出新窗体. 放入用户控件 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_37214567/artic ...
- 从0到1:使用Caliburn.Micro(WPF和MVVM)开发简单的计算器
从0到1:使用Caliburn.Micro(WPF和MVVM)开发简单的计算器 之前时间一直在使用Caliburn.Micro这种应用了MVVM模式的WPF框架做开发,是时候总结一下了. Calibu ...
- C#开发微信门户及应用(5)--用户分组信息管理
在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继续写这个系列的博客了,并不是对这个方面停止了研究,而是继续深入探索这方面的技术,为了更好的应用起 ...
- [课程设计]Scrum 1. 9 多鱼点餐系统开发进度(最后页面完善&修复BUG&用户测试反馈)
[课程设计]Scrum 1. 9 多鱼点餐系统开发进度(最后页面完善&修复BUG&用户测试) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢 ...
- CleanAOP实战系列--WPF中MVVM自动更新
CleanAOP实战系列--WPF中MVVM自动更新 作者: 立地 邮箱: jarvin_g@126.com QQ: 511363759 CleanAOP介绍:https://github.com/J ...
- 微信开发第4章 通过accesstoken获取用户标签管理
通过access_token获取用户标签管理: 1.获取标签列表 调用接口为: http请求方式:GET(请使用https协议) https://api.weixin.qq.com/cgi-bin/t ...
随机推荐
- Linux 内核概述 - Linux Kernel
Linux 内核学习笔记整理. Unix unix 已有40历史,但计算机科学家仍认为其是现存操作系统中最大和最优秀的系统,它已成为一种传奇的存在,历经时间的考验却依然声名不坠. 1973 年,在用 ...
- 使用CSS3实现一个3D相册
CSS3系列我已经写过两篇文章,感兴趣的同学可以先看一下CSS3初体验之奇技淫巧,CSS3 3D立方体效果-transform也不过如此 第一篇主要列出了一些常用或经典的CSS3技巧和方法:第二篇是一 ...
- 【原】FMDB源码阅读(一)
[原]FMDB源码阅读(一) 本文转载请注明出处 —— polobymulberry-博客园 1. 前言 说实话,之前的SDWebImage和AFNetworking这两个组件我还是使用过的,但是对于 ...
- SQL Server-聚焦NOT IN VS NOT EXISTS VS LEFT JOIN...IS NULL性能分析(十八)
前言 本节我们来综合比较NOT IN VS NOT EXISTS VS LEFT JOIN...IS NULL的性能,简短的内容,深入的理解,Always to review the basics. ...
- python与c互相调用
虽然python开发效率很高,但作为脚本语言,其性能不高,所以为了兼顾开发效率和性能,通常把性能要求高的模块用c或c++来实现或者在c或c++中运行python脚本来处理逻辑,前者通常是python中 ...
- 【JS基础】循环
for 循环的语法: for (语句 1; 语句 2; 语句 3) { 被执行的代码块 } 语句 1 在循环(代码块)开始前执行 语句 2 定义运行循环(代码块)的条件 语句 3 在循环(代码块)已被 ...
- Kotlin的android扩展:对findViewById说再见(KAD 04)
作者:Antonio Leiva 时间:Dec 12, 2016 原文链接:http://antonioleiva.com/kotlin-android-extensions/ 你也许已厌倦日复一日使 ...
- 发布APP到app store
好久好久没写博客了,主要是 都在学习新东西,忙不赢啊. 近段时间在用AC平台学习开发移动APP, 今天开始发布应用. 在ac云控制台编译成ipa后,使用apple提供的Application Load ...
- [转载]敏捷开发之Scrum扫盲篇
现在敏捷开发是越来越火了,人人都在谈敏捷,人人都在学习Scrum和XP... 为了不落后他人,于是我也开始学习Scrum,今天主要是对我最近阅读的相关资料,根据自己的理解,用自己的话来讲述S ...
- Bluemix中国版体验(二)
从上一篇到现在大概有一个多月了.时隔一个月再登录中国版Bluemix,发现界面竟然更新了,现在的风格和国际版已经基本保持一致!这次我们来体验一下Mobile Service.不过mobile serv ...