看过我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 【续】修复部分用户无法获取列表的更多相关文章

  1. WPF 微信 MVVM 【续】发送部分QQ表情

    今天主要记录的就是发送QQ表情, WPF 微信 MVVM里写了,后期为了发送QQ表情,需要把TextBox替换为RichTextBox,接下来就说说替换的过程. 一.支持Binding的RichTex ...

  2. WPF 微信 MVVM

    公司的同事离职了,接下来的日子可能会忙碌,能完善DEMO的时间也会少了,因此,把做的简易DEMO整体先记录一下,等后续不断的完善. 参考两位大神的日志:WEB版微信协议部分功能分析.[完全开源]微信客 ...

  3. JAVA微信公众号网页开发 —— 用户授权获取openid

    官方文档:https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842 HttpClientUtil.java packa ...

  4. WPF Prism MVVM 中 弹出新窗体. 放入用户控件

    原文:WPF Prism MVVM 中 弹出新窗体. 放入用户控件 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_37214567/artic ...

  5. 从0到1:使用Caliburn.Micro(WPF和MVVM)开发简单的计算器

    从0到1:使用Caliburn.Micro(WPF和MVVM)开发简单的计算器 之前时间一直在使用Caliburn.Micro这种应用了MVVM模式的WPF框架做开发,是时候总结一下了. Calibu ...

  6. C#开发微信门户及应用(5)--用户分组信息管理

    在上个月的对C#开发微信门户及应用做了介绍,写过了几篇的随笔进行分享,由于时间关系,间隔了一段时间没有继续写这个系列的博客了,并不是对这个方面停止了研究,而是继续深入探索这方面的技术,为了更好的应用起 ...

  7. [课程设计]Scrum 1. 9 多鱼点餐系统开发进度(最后页面完善&修复BUG&用户测试反馈)

    [课程设计]Scrum 1. 9 多鱼点餐系统开发进度(最后页面完善&修复BUG&用户测试) 1.团队名称:重案组 2.团队目标:长期经营,积累客户充分准备,伺机而行 3.团队口号:矢 ...

  8. CleanAOP实战系列--WPF中MVVM自动更新

    CleanAOP实战系列--WPF中MVVM自动更新 作者: 立地 邮箱: jarvin_g@126.com QQ: 511363759 CleanAOP介绍:https://github.com/J ...

  9. 微信开发第4章 通过accesstoken获取用户标签管理

    通过access_token获取用户标签管理: 1.获取标签列表 调用接口为: http请求方式:GET(请使用https协议) https://api.weixin.qq.com/cgi-bin/t ...

随机推荐

  1. 百度MIP移动页面加速——不只是CDN

    MIP是用CDN做加速的么?准确答案是:是,但不只是. MIP全称Mobile Instant Pages,移动网页加速器,是百度提出的页面加速解决方案.MIP从前端渲染和页面网络传输两方面进行优化, ...

  2. 事务日志已满,原因为“ACTIVE_TRANSACTION”

    汇总篇:http://www.cnblogs.com/dunitian/p/4822808.html#tsql 异常处理汇总-数据库系列  http://www.cnblogs.com/dunitia ...

  3. JavaScript模仿块级作用域

    avaScript 没有块级作用域的概念.这意味着在块语句中定义的变量,实际上是在包含函数中而非语句中创建的,来看下面的例子: function outputNumbers(count){ for ( ...

  4. DataTable 转换成 Json的3种方法

    在web开发中,我们可能会有这样的需求,为了便于前台的JS的处理,我们需要将查询出的数据源格式比如:List<T>.DataTable转换为Json格式.特别在使用Extjs框架的时候,A ...

  5. Windos环境用Nginx配置反向代理和负载均衡

    Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...

  6. 【SAP业务模式】之ICS(五):定价配置

    本篇博文讲述ICS业务中的定价配置. 1.定义销售订单类型 目录:SPRO-销售与分销-销售-销售凭证-销售凭证抬头-定义销售凭证类型 事务代码:VOV8 2.定义销售订单类型 目录:SPRO-销售与 ...

  7. Kotlin与Android SDK 集成(KAD 05)

    作者:Antonio Leiva 时间:Dec 19, 2016 原文链接:https://antonioleiva.com/kotlin-integrations-android-sdk/ 使用Ko ...

  8. Vim使用

    模式 ESC\Ctrl+c:退出编辑模式 ZZ\wq:命令模式下保存退出 编辑 i:进入编辑模式 I:转到行首非空字符开始编辑 s:删除当前字符进入编辑模式 a:从当前字符后开始编辑 A:从当前行末非 ...

  9. 设置WindowServer2012 时间同步NTP

    在powershell中以管理员身份运行以下命令即可 w32tm /config /manualpeerlist:pool.ntp.org /syncfromflags:MANUAL Stop-Ser ...

  10. Struts的文件上传下载

    Struts的文件上传下载 1.文件上传 Struts2的文件上传也是使用fileUpload的组件,这个组默认是集合在框架里面的.且是使用拦截器:<interceptor name=" ...