代码拉取完成,页面将自动刷新
同步操作将从 codeman35/weixinHttpApi 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
using FluorineFx.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using System.Xml;
namespace WeiXinZhuaFaWang
{
public partial class MainForm : Form
{
void SendHeader(HttpClient client, string header)
{
string[] arr = header.Replace("\r", "\n").Replace("\n\n", "\n").Split('\n');
foreach (string s in arr)
{
if (string.IsNullOrEmpty(s)) break;
if (s.StartsWith("GET", StringComparison.OrdinalIgnoreCase))
{
continue;
}
if (s.StartsWith("POST", StringComparison.OrdinalIgnoreCase))
{
continue;
}
if (s.StartsWith("Cookie", StringComparison.OrdinalIgnoreCase)) continue;
int x = s.IndexOf(":");
if (x > 0)
{
try
{
var k = s.Substring(0, x);
client.DefaultRequestHeaders.Remove(k);
client.DefaultRequestHeaders.Add(k, s.Substring(x + 1));
}
catch { }
}
}
}
int DateTimeToStamp(System.DateTime time)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
return (int)(time - startTime).TotalSeconds;
}
/// <summary>
/// "\"(.*?)\""
/// </summary>
/// <param name="result"></param>
/// <param name="code"></param>
/// <param name="regex"></param>
/// <returns></returns>
string GetCodeString(string result, string code, string regex)
{
if (result.IndexOf(code) != -1)
{
Regex reg = new Regex(regex);
Match m = reg.Match(result);
while (m.Success)
{
return m.Groups[1].Value;
}
}
//没有找到
throw new Exception("GetCodeString err");
}
string GetResultString(string result, string regex)
{
Regex reg = new Regex(regex);
Match m = reg.Match(result);
while (m.Success)
{
return m.Groups[1].Value;
}
return "";
}
string GetDeflateByStream(Stream stream, string encoding = "UTF-8")
{
List<Byte> list = new List<byte>();
int b = 0;
while ((b = stream.ReadByte()) != -1)
list.Add((byte)b);
string result = "";
using (MemoryStream ms = new MemoryStream(list.ToArray()))
{
using (DeflateStream zipStream = new DeflateStream(ms, CompressionMode.Decompress))
using (StreamReader sr = new StreamReader(zipStream, Encoding.GetEncoding(encoding)))
result = sr.ReadToEnd();
}
//
return result;
}
string ReplaceKey(string s)
{
s = s.Replace("{time}", DateTimeToStamp(DateTime.Now) + "");
s = s.Replace("{uuid}", UUID + "");
s = s.Replace("{pass_ticket}", step4xml.pass_ticket);
s = s.Replace("{UIN}", step4xml.wxuin + "");
s = s.Replace("{SID}", step4xml.wxsid + "");
s = s.Replace("{DeviceID}", DeviceID + "");
s = s.Replace("{SKEY}", step4xml.skey + "");
s = s.Replace("[number]", WXNUMBER);
return s;
}
string ReplaceHeaderKey(string s)
{
s = s.Replace("{webwx_data_ticket}", COOKIES["webwx_data_ticket"]);
s = s.Replace("{UIN}", step4xml.wxuin + "");
s = s.Replace("{SID}", step4xml.wxsid + "");
s = s.Replace("{DeviceID}", DeviceID + "");
s = s.Replace("{SKEY}", step4xml.skey + "");
s = s.Replace("{time}", DateTimeToStamp(DateTime.Now) + "");
s = s.Replace("{pass_ticket}", step4xml.pass_ticket);
s = s.Replace("{SyncKey}", SyncKey + "");
s = s.Replace("[number]", WXNUMBER);
return s;
}
}
public class Step4XML
{
public int ret { get; set; }
public string message { get; set; }
public string skey { get; set; }
public string wxsid { get; set; }
public string wxuin { get; set; }
public string pass_ticket { get; set; }
public string isgrayscale { get; set; }
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。