WxConnectorLib 0.1.1
dotnet add package WxConnectorLib --version 0.1.1
NuGet\Install-Package WxConnectorLib -Version 0.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WxConnectorLib" Version="0.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WxConnectorLib" Version="0.1.1" />
<PackageReference Include="WxConnectorLib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WxConnectorLib --version 0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WxConnectorLib, 0.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WxConnectorLib@0.1.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WxConnectorLib&version=0.1.1
#tool nuget:?package=WxConnectorLib&version=0.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WxConnectorLib
写在前面
欢迎各位指出bug提出Issue,也欢迎各位提交PR使项目变得更好
项目简介
WxConnectorLib 是一个基于 .Net Core 8.0 开发的微信操作模拟库 面向微信版本 3.9.12.xx 开发
旨在替代 wxauto 作为新的免费开源的微信操作模拟库
因为 wxauto 实在是太慢了,还没有类型检查,故开发了此项目
相关资源
WeChat 3.9.12 安装包 https://www.123912.com/s/trNHjv-Hi9GA
.Net 8.0.15 Runtime-win-x64 https://www.123912.com/s/trNHjv-Ai9GA
快速开始
先在项目中添加对 WxConnectorLib 的引用
NuGet\Install-Package WxConnectorLib
或在Nuget包管理器中搜索 WxConnectorLib 进行安装
// 引入需要的命名空间
using WxConnectorLib.Managers;
using WxConnectorLib.Utils;
// 使用ActionUtil类进行启动微信和打开监听窗口
// LoginAction会使用传入的exe路径启动微信并等待登录
ActionUtil.Get().LoginAction(@"C:\Program Files\Tencent\WeChat\WeChat.exe");
// OpenListenerWindowsAction对传入的用户打开独立监听窗口
// 并返回监听窗口列表(这里传入的字符串是好友备注名和群名)
var listeners = ActionUtil.Get().OpenListenerWindowsAction(["测试用户", "测试机器人群聊"]);
// 设置一些消息的保存路径(如文件、图片等)
MessageUtil.Get().SetSavePath(".data");
// 使用ListenManager类进行消息监听
ListenManager.Get().InitListen(listener)
// 使用EventManager类来挂载事件处理函数
EventManager.Get().OnNewMessage += (message, chatWindow) => Console.WriteLine($"从{chatWindow.Title}收到消息:{message}");
// ActionUtil类提供了发送文字消息与文件消息的方法
// window参数指定了需要向哪一个用户独立监听窗口发送消息
// 可以从事件处理函数中获取到,也可以从OpenListenerWindowsAction中获取
ActionUtil.Get().SendTextMessage("这是一条测试文字消息", window);
文档
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0-windows7.0
- FlaUI.UIA3 (>= 5.0.0)
- Microsoft.Windows.Compatibility (>= 9.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
增加了At和引用消息的功能、增加了初始化监听窗口的容错,并修复了监听时不能打字的问题