parent
8fbb071762
commit
af16b11e2c
|
@ -420,7 +420,7 @@ namespace FLSystem.Forms
|
||||||
private void barButtonItem46_ItemClick(object sender, ItemClickEventArgs e)
|
private void barButtonItem46_ItemClick(object sender, ItemClickEventArgs e)
|
||||||
{
|
{
|
||||||
//TODO 快手
|
//TODO 快手
|
||||||
return;
|
//return;
|
||||||
LoginCps(CpsType.快手联盟);
|
LoginCps(CpsType.快手联盟);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1333,7 +1333,7 @@ namespace FLSystem.Forms
|
||||||
case "快手订单管理":
|
case "快手订单管理":
|
||||||
{
|
{
|
||||||
//TODO 快手
|
//TODO 快手
|
||||||
throw new Exception("该功能尚未开发完成,请等待更新!");
|
//throw new Exception("该功能尚未开发完成,请等待更新!");
|
||||||
control = new cps_order_kuaishou(username);
|
control = new cps_order_kuaishou(username);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2569,7 +2569,7 @@ namespace FLSystem.Forms
|
||||||
private void barButtonItem108_ItemClick(object sender, ItemClickEventArgs e)
|
private void barButtonItem108_ItemClick(object sender, ItemClickEventArgs e)
|
||||||
{
|
{
|
||||||
//TODO 快手
|
//TODO 快手
|
||||||
return;
|
//return;
|
||||||
if (LoginCps(CpsType.快手联盟) != null)
|
if (LoginCps(CpsType.快手联盟) != null)
|
||||||
ItemClick(btn_cps_manage, e);
|
ItemClick(btn_cps_manage, e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,9 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>tencent_qqpim_72px_1127550_easyicon.net.ico</ApplicationIcon>
|
<ApplicationIcon>tencent_qqpim_72px_1127550_easyicon.net.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="FluentScheduler, Version=5.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FluentScheduler, Version=5.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentScheduler.5.5.1\lib\netstandard2.0\FluentScheduler.dll</HintPath>
|
<HintPath>..\packages\FluentScheduler.5.5.1\lib\netstandard2.0\FluentScheduler.dll</HintPath>
|
||||||
|
@ -311,6 +314,7 @@
|
||||||
<DependentUpon>WechatUpdate.cs</DependentUpon>
|
<DependentUpon>WechatUpdate.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
<None Include="Properties\app.manifest" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
|
|
@ -70,7 +70,6 @@
|
||||||
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
this.timer1 = new System.Windows.Forms.Timer(this.components);
|
||||||
this.label5 = new System.Windows.Forms.Label();
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
this.timer2 = new System.Windows.Forms.Timer(this.components);
|
this.timer2 = new System.Windows.Forms.Timer(this.components);
|
||||||
this.timer3 = new System.Windows.Forms.Timer(this.components);
|
|
||||||
this.tabControl1.SuspendLayout();
|
this.tabControl1.SuspendLayout();
|
||||||
this.tabPage1.SuspendLayout();
|
this.tabPage1.SuspendLayout();
|
||||||
this.contextMenuStrip1.SuspendLayout();
|
this.contextMenuStrip1.SuspendLayout();
|
||||||
|
@ -279,9 +278,9 @@
|
||||||
this.checkBox1.AutoSize = true;
|
this.checkBox1.AutoSize = true;
|
||||||
this.checkBox1.Location = new System.Drawing.Point(35, 29);
|
this.checkBox1.Location = new System.Drawing.Point(35, 29);
|
||||||
this.checkBox1.Name = "checkBox1";
|
this.checkBox1.Name = "checkBox1";
|
||||||
this.checkBox1.Size = new System.Drawing.Size(336, 16);
|
this.checkBox1.Size = new System.Drawing.Size(300, 16);
|
||||||
this.checkBox1.TabIndex = 7;
|
this.checkBox1.TabIndex = 7;
|
||||||
this.checkBox1.Text = "开启防微信消息延迟功能(注:会模拟切换点击微信界面)";
|
this.checkBox1.Text = "开启防微信消息延迟功能(注:模拟用户发送消息)";
|
||||||
this.checkBox1.UseVisualStyleBackColor = true;
|
this.checkBox1.UseVisualStyleBackColor = true;
|
||||||
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
|
||||||
//
|
//
|
||||||
|
@ -456,12 +455,6 @@
|
||||||
this.timer2.Interval = 6000;
|
this.timer2.Interval = 6000;
|
||||||
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
|
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
|
||||||
//
|
//
|
||||||
// timer3
|
|
||||||
//
|
|
||||||
this.timer3.Enabled = true;
|
|
||||||
this.timer3.Interval = 60000;
|
|
||||||
this.timer3.Tick += new System.EventHandler(this.timer3_Tick);
|
|
||||||
//
|
|
||||||
// PCRobotForm
|
// PCRobotForm
|
||||||
//
|
//
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||||
|
@ -479,6 +472,7 @@
|
||||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PCRobotForm_FormClosing);
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.PCRobotForm_FormClosing);
|
||||||
this.Load += new System.EventHandler(this.PCRobotForm_Load);
|
this.Load += new System.EventHandler(this.PCRobotForm_Load);
|
||||||
this.SizeChanged += new System.EventHandler(this.PCRobotForm_SizeChanged);
|
this.SizeChanged += new System.EventHandler(this.PCRobotForm_SizeChanged);
|
||||||
|
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PCRobotForm_MouseDown);
|
||||||
this.tabControl1.ResumeLayout(false);
|
this.tabControl1.ResumeLayout(false);
|
||||||
this.tabPage1.ResumeLayout(false);
|
this.tabPage1.ResumeLayout(false);
|
||||||
this.tabPage1.PerformLayout();
|
this.tabPage1.PerformLayout();
|
||||||
|
@ -535,7 +529,6 @@
|
||||||
private System.Windows.Forms.Button button8;
|
private System.Windows.Forms.Button button8;
|
||||||
private System.Windows.Forms.Label label7;
|
private System.Windows.Forms.Label label7;
|
||||||
private System.Windows.Forms.ColumnHeader columnHeader1;
|
private System.Windows.Forms.ColumnHeader columnHeader1;
|
||||||
private System.Windows.Forms.Timer timer3;
|
|
||||||
private System.Windows.Forms.CheckBox checkBox1;
|
private System.Windows.Forms.CheckBox checkBox1;
|
||||||
private System.Windows.Forms.GroupBox groupBox2;
|
private System.Windows.Forms.GroupBox groupBox2;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,15 +40,7 @@ namespace PCRobot
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//var file = @"C:\Users\XianSenWu\Documents\WeChat Files\wxid_b9qk6hpmh0s812\config\AccInfo.dat";
|
//Common.MainExeHandle = this.Handle;
|
||||||
//var fileStream = File.ReadAllBytes(file);
|
|
||||||
|
|
||||||
//var text = Encoding.UTF8.GetString(fileStream);
|
|
||||||
//Console.WriteLine(text);
|
|
||||||
|
|
||||||
//var nickbyte = Encoding.UTF8.GetBytes("小张晚安");
|
|
||||||
|
|
||||||
//Console.WriteLine();
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -61,6 +53,7 @@ namespace PCRobot
|
||||||
files.Add(HttpExtend.MapFile(@"OnlineUpdate.exe"));
|
files.Add(HttpExtend.MapFile(@"OnlineUpdate.exe"));
|
||||||
//files.Add(Util.MapFile(@"WeiQ.Framework.dll", @"Assembly\apifile"));
|
//files.Add(Util.MapFile(@"WeiQ.Framework.dll", @"Assembly\apifile"));
|
||||||
//files.Add(Util.MapFile(@"Browser.dll", @"Assembly\apifile\Library"));
|
//files.Add(Util.MapFile(@"Browser.dll", @"Assembly\apifile\Library"));
|
||||||
|
|
||||||
foreach (var item in files)
|
foreach (var item in files)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -68,7 +61,8 @@ namespace PCRobot
|
||||||
File.Delete(item);
|
File.Delete(item);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{ }
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
@ -88,58 +82,193 @@ namespace PCRobot
|
||||||
Wechat_Xiaoxie.ClickEvent += SystemLoginWechat;
|
Wechat_Xiaoxie.ClickEvent += SystemLoginWechat;
|
||||||
|
|
||||||
IniData();
|
IniData();
|
||||||
|
|
||||||
this.label5.Text = "版本:" + Common.CurVersion;
|
this.label5.Text = "版本:" + Common.CurVersion;
|
||||||
//MessageBox.Show("版本:" + Common.CurVersion);
|
//MessageBox.Show("版本:" + Common.CurVersion);
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(Config.GetValue("设置", "静态")))
|
||||||
|
{
|
||||||
|
Config.SetValue("设置", "静态", "FALSE");
|
||||||
|
}
|
||||||
|
|
||||||
|
checkBox1.Checked = Config.GetValue("设置", "静态").ToUpper() != "TRUE";
|
||||||
|
|
||||||
if (Config.GetValue("设置", "内部").ToUpper() == "TRUE")
|
if (Config.GetValue("设置", "内部").ToUpper() == "TRUE")
|
||||||
{
|
{
|
||||||
#region 需要解析的微信消息
|
#region 需要解析的微信消息
|
||||||
var temp = "MT_USER_LOGIN,MT_USER_LOGOUT,MT_DATA_CHATROOM_MEMBERS_MSG,MT_DATA_CHATROOMS_MSG,MT_DATA_FRIENDS_MSG,MT_DATA_WXID_MSG";
|
|
||||||
|
var temp =
|
||||||
|
"MT_USER_LOGIN,MT_USER_LOGOUT,MT_DATA_CHATROOM_MEMBERS_MSG,MT_DATA_CHATROOMS_MSG,MT_DATA_FRIENDS_MSG,MT_DATA_WXID_MSG";
|
||||||
if (Common.AppConfig_ExistItem("AnalysisTypes"))
|
if (Common.AppConfig_ExistItem("AnalysisTypes"))
|
||||||
temp = Common.AppConfig_Get("AnalysisTypes");
|
temp = Common.AppConfig_Get("AnalysisTypes");
|
||||||
else
|
else
|
||||||
Common.AppConfig_Add("AnalysisTypes", temp);
|
Common.AppConfig_Add("AnalysisTypes", temp);
|
||||||
|
|
||||||
AnalysisTypes = temp.Replace(",", ",").Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).Select(f => f.Trim().ToUpper()).ToList();
|
AnalysisTypes = temp.Replace(",", ",")
|
||||||
|
.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)
|
||||||
|
.Select(f => f.Trim().ToUpper()).ToList();
|
||||||
richTextBox1.Text = Common.AppConfig_Get("AnalysisTypes");
|
richTextBox1.Text = Common.AppConfig_Get("AnalysisTypes");
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 自动处理会话已读
|
#region 自动处理会话已读
|
||||||
|
|
||||||
var temp2 = "0";
|
var temp2 = "0";
|
||||||
if (Common.AppConfig_ExistItem("IsHaveRead"))
|
if (Common.AppConfig_ExistItem("IsHaveRead"))
|
||||||
temp2 = Common.AppConfig_Get("IsHaveRead");
|
temp2 = Common.AppConfig_Get("IsHaveRead");
|
||||||
else
|
else
|
||||||
Common.AppConfig_Add("IsHaveRead", "0");
|
Common.AppConfig_Add("IsHaveRead", "0");
|
||||||
IsHaveRead = checkBox2.Checked = temp2 == "1";
|
IsHaveRead = checkBox2.Checked = temp2 == "1";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if (!Common.AppConfig_ExistItem("RunAppName"))
|
if (!Common.AppConfig_ExistItem("RunAppName"))
|
||||||
Common.AppConfig_Add("RunAppName", "易转发");
|
Common.AppConfig_Add("RunAppName", "易转发");
|
||||||
}
|
}
|
||||||
|
catch (Exception exception)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
else
|
else
|
||||||
tabPage3.Parent = null;
|
tabPage3.Parent = null;
|
||||||
|
|
||||||
if (!Common.AppConfig_ExistItem("设置"))
|
|
||||||
Common.AppConfig_Add("设置", "静态");
|
|
||||||
|
|
||||||
checkBox1.Checked = Config.GetValue("设置", "静态").ToUpper() != "TRUE";
|
|
||||||
|
|
||||||
ErrorMessAction = ErrorMess;
|
ErrorMessAction = ErrorMess;
|
||||||
|
|
||||||
//设置标题
|
//设置标题
|
||||||
var title = Regex.Replace(Process.GetCurrentProcess().MainModule.ModuleName, ".exe", "", RegexOptions.IgnoreCase);
|
var title = Regex.Replace(Process.GetCurrentProcess().MainModule.ModuleName, ".exe", "",
|
||||||
|
RegexOptions.IgnoreCase);
|
||||||
if (string.IsNullOrWhiteSpace(title) || title.Contains("易转发"))
|
if (string.IsNullOrWhiteSpace(title) || title.Contains("易转发"))
|
||||||
title = Util.GetRandomString(5);
|
title = Util.GetRandomString(5);
|
||||||
this.Text = title;
|
this.Text = title;
|
||||||
//this.Text = Guid.NewGuid().ToString("N");
|
//this.Text = Guid.NewGuid().ToString("N");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("异常 = " + ex.Message + " --- " + ex.StackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
//自动切换聊天对象
|
//自动切换聊天对象
|
||||||
var th = new Thread(OnHandle);
|
var th = new Thread(OnHandle);
|
||||||
th.IsBackground = true;
|
th.IsBackground = true;
|
||||||
th.Start();
|
th.Start();
|
||||||
|
|
||||||
|
//切换窗口
|
||||||
|
var th1 = new Thread(OnActivationHandle);
|
||||||
|
th1.IsBackground = true;
|
||||||
|
th1.Start();
|
||||||
|
|
||||||
|
//发送消息
|
||||||
|
var th2 = new Thread(OnSendHandle);
|
||||||
|
th2.IsBackground = true;
|
||||||
|
th2.Start();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{ }
|
||||||
|
}
|
||||||
|
|
||||||
|
List<string> userNameList = new List<string>() { /*"newsapp",*/ "gh_3dfda90e39d6", "weixin", "weixin", "weixin", "gh_7aac992b0363", "weixin"/*, "notifymessage"*/ };
|
||||||
|
|
||||||
|
private Dictionary<string, bool> PublicUserCache = new Dictionary<string, bool>();
|
||||||
|
|
||||||
|
private void OnSendHandle()
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000 * new Random(Guid.NewGuid().GetHashCode()).Next(50, 100));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Config.GetValue("设置", "静态").ToUpper() == "TRUE")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append("开启激活;");
|
||||||
|
var users = WechatClient.Users.Values.ToList();
|
||||||
|
if (users.Count <= 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append($"{users.Count}个微信;");
|
||||||
|
|
||||||
|
foreach (var user in users)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var client = WechatClient.GetApi(user);
|
||||||
|
if (client != null)
|
||||||
|
{
|
||||||
|
if (client.User.Type == WechatType.Xiaoxie_QY)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var robot = client as Wechat_Xiaoxie;
|
||||||
|
if (robot != null)
|
||||||
|
{
|
||||||
|
var index = new Random(Guid.NewGuid().GetHashCode()).Next(0, userNameList.Count);
|
||||||
|
var username = userNameList[index];
|
||||||
|
|
||||||
|
if (username.StartsWith("gh_", StringComparison.CurrentCultureIgnoreCase))
|
||||||
|
{
|
||||||
|
if (!PublicUserCache.ContainsKey(username))
|
||||||
|
{
|
||||||
|
PublicUserCache[username] = true;
|
||||||
|
robot.AddPublicUser(username);
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append($"{robot.User.Nickname}({robot.User.Wxid})执行发送");
|
||||||
|
|
||||||
|
robot.SendMessage(userNameList[index],
|
||||||
|
DateTime.Now
|
||||||
|
.AddSeconds(
|
||||||
|
-new Random(Guid.NewGuid().GetHashCode()).Next(1000000, 9000000))
|
||||||
|
.ToString("HHmmssffffdd"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{ }
|
{
|
||||||
|
LogHelper.GetSingleObj().Error("激活", ex.Message);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("定时消息", sb.ToString());
|
||||||
|
}
|
||||||
|
Thread.Sleep(500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Error("激活", ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnActivationHandle()
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000 * 60);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Config.GetValue("设置", "静态").ToUpper() != "TRUE")
|
||||||
|
{
|
||||||
|
Common.ActivateWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Error("EnableError", $"{ex.Message} - {ex.StackTrace}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1053,17 +1182,7 @@ namespace PCRobot
|
||||||
|
|
||||||
private void timer3_Tick(object sender, EventArgs e)
|
private void timer3_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
if (Config.GetValue("设置", "静态").ToUpper() != "TRUE")
|
|
||||||
{
|
|
||||||
Common.ActivateWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
LogHelper.GetSingleObj().Error("EnableError", $"{ex.Message} - {ex.StackTrace}");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void button9_Click(object sender, EventArgs e)
|
private void button9_Click(object sender, EventArgs e)
|
||||||
|
@ -1080,13 +1199,17 @@ namespace PCRobot
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Config.SetValue("设置", "静态", checkBox1.Checked ? "FALSE" : "TRUE");
|
Config.SetValue("设置", "静态", (checkBox1.Checked ? "FALSE" : "TRUE"));
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine(exception);
|
LogHelper.GetSingleObj().Info("修改激活配置", $"{ex.Message}");
|
||||||
throw;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PCRobotForm_MouseDown(object sender, MouseEventArgs e)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("窗口被点击", $"主程序窗口被点击 => x:{e.X};y:{e.Y}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -496,9 +496,6 @@
|
||||||
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="timer2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>342, 21</value>
|
<value>342, 21</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="timer3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>432, 21</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>58</value>
|
<value>58</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
||||||
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
|
<security>
|
||||||
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<!-- UAC 清单选项
|
||||||
|
如果想要更改 Windows 用户帐户控制级别,请使用
|
||||||
|
以下节点之一替换 requestedExecutionLevel 节点。n
|
||||||
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||||
|
|
||||||
|
指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
|
||||||
|
如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
|
||||||
|
元素。
|
||||||
|
-->
|
||||||
|
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||||
|
</requestedPrivileges>
|
||||||
|
</security>
|
||||||
|
</trustInfo>
|
||||||
|
|
||||||
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
|
<application>
|
||||||
|
<!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
|
||||||
|
Windows 版本的列表。取消评论适当的元素,
|
||||||
|
Windows 将自动选择最兼容的环境。 -->
|
||||||
|
|
||||||
|
<!-- Windows Vista -->
|
||||||
|
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 7 -->
|
||||||
|
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 8 -->
|
||||||
|
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 8.1 -->
|
||||||
|
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||||
|
|
||||||
|
<!-- Windows 10 -->
|
||||||
|
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||||
|
|
||||||
|
</application>
|
||||||
|
</compatibility>
|
||||||
|
|
||||||
|
<!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
|
||||||
|
自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
|
||||||
|
选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
|
||||||
|
在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
|
||||||
|
<!--
|
||||||
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
<windowsSettings>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||||
|
</windowsSettings>
|
||||||
|
</application>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
|
||||||
|
<!--
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity
|
||||||
|
type="win32"
|
||||||
|
name="Microsoft.Windows.Common-Controls"
|
||||||
|
version="6.0.0.0"
|
||||||
|
processorArchitecture="*"
|
||||||
|
publicKeyToken="6595b64144ccf1df"
|
||||||
|
language="*"
|
||||||
|
/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
|
</assembly>
|
|
@ -400,18 +400,16 @@ namespace PCRobot.Utils
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
private static extern bool SetCursorPos(int x, int y);
|
private static extern bool SetCursorPos(int x, int y);
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
|
||||||
public static extern bool ReleaseCapture();
|
|
||||||
|
|
||||||
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
|
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
|
||||||
public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);
|
public static extern int SendMessage(IntPtr hwnd, int wMsg, IntPtr wParam, IntPtr lParam);
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("USER32.DLL")]
|
[System.Runtime.InteropServices.DllImport("USER32.DLL")]
|
||||||
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
private static extern bool SetForegroundWindow(IntPtr hWnd);
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("USER32.dll")]
|
[System.Runtime.InteropServices.DllImport("USER32.dll")]
|
||||||
private static extern int ShowWindow(IntPtr hwnd, uint nCmdShow);
|
private static extern int ShowWindow(IntPtr hwnd, uint nCmdShow);
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||||
private static extern IntPtr SetActiveWindow(IntPtr hWnd);
|
private static extern bool SetActiveWindow(IntPtr hWnd);
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "FindWindow")] //声明FindWindowAPI
|
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "FindWindow")] //声明FindWindowAPI
|
||||||
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
|
private static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
|
||||||
|
@ -419,6 +417,9 @@ namespace PCRobot.Utils
|
||||||
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
[System.Runtime.InteropServices.DllImport("user32.dll")]
|
||||||
private static extern IntPtr FindWindowExA(IntPtr parentHandle, IntPtr childAfter, string lpClassName, string lpWindowName);
|
private static extern IntPtr FindWindowExA(IntPtr parentHandle, IntPtr childAfter, string lpClassName, string lpWindowName);
|
||||||
|
|
||||||
|
[DllImport("User32.dll", EntryPoint = "SendMessage")]
|
||||||
|
private static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
|
||||||
|
|
||||||
[System.Runtime.InteropServices.DllImport("user32")]
|
[System.Runtime.InteropServices.DllImport("user32")]
|
||||||
private static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
|
private static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
|
||||||
|
|
||||||
|
@ -434,14 +435,85 @@ namespace PCRobot.Utils
|
||||||
private const int VM_NCLBUTTONDOWN = 0XA1;//定义鼠标左键按下
|
private const int VM_NCLBUTTONDOWN = 0XA1;//定义鼠标左键按下
|
||||||
private const int HTCAPTION = 2;
|
private const int HTCAPTION = 2;
|
||||||
|
|
||||||
|
|
||||||
|
[System.Runtime.InteropServices.DllImport("User32.dll")]
|
||||||
|
private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);
|
||||||
|
|
||||||
|
public const int SW_HIDE = 0;
|
||||||
|
public const int SW_SHOWNORMAL = 1;
|
||||||
|
public const int SW_NORMAL = 1;
|
||||||
|
public const int SW_SHOWMINIMIZED = 2;
|
||||||
|
public const int SW_SHOWMAXIMIZED = 3;
|
||||||
|
public const int SW_MAXIMIZE = 3;
|
||||||
|
public const int SW_SHOWNOACTIVATE = 4;
|
||||||
|
public const int SW_SHOW = 5;
|
||||||
|
public const int SW_MINIMIZE = 6;
|
||||||
|
public const int SW_SHOWMINNOACTIVE = 7;
|
||||||
|
public const int SW_SHOWNA = 8;
|
||||||
|
public const int SW_RESTORE = 9;
|
||||||
|
public const int SW_SHOWDEFAULT = 10;
|
||||||
|
public const int SW_FORCEMINIMIZE = 11;
|
||||||
|
public const int SW_MAX = 11;
|
||||||
|
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndlnsertAfter, int X, int Y, int cx, int cy, uint Flags);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关闭微信更新窗口
|
||||||
|
/// </summary>
|
||||||
|
private static void CloseWeChatUpdateWindow()
|
||||||
|
{
|
||||||
|
//最多循环10次,一般不可能一台服务器登录超过10个机器人,我怕有BUG死循环
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
var handle = IntPtr.Zero;
|
||||||
|
var rstHandlePtr = FindWindowExA(IntPtr.Zero, handle, "UpdateWnd", "升级");
|
||||||
|
if (rstHandlePtr == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 没有升级");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 升级");
|
||||||
|
SendMessage(rstHandlePtr, 0x0010, 0, 0);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 升级 异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
var handle = IntPtr.Zero;
|
||||||
|
var rstHandlePtr = FindWindowExA(IntPtr.Zero, handle, "UpdateWnd", "新版本");
|
||||||
|
if (rstHandlePtr == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 没有新版本");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 新版本");
|
||||||
|
SendMessage(rstHandlePtr, 0x0010, 0, 0);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LogHelper.GetSingleObj().Info("更新窗口", "检测到更新窗口 => 新版本 异常");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激活个人微信窗口
|
/// 激活个人微信窗口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static void ActivateWindow(String lpClassName, string lpWindowName)
|
private static void ActivateWindow(string lpClassName, string lpWindowName)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//主窗口句柄
|
//主窗口句柄
|
||||||
|
@ -455,32 +527,20 @@ namespace PCRobot.Utils
|
||||||
if (handleList.Contains(handle)) break;
|
if (handleList.Contains(handle)) break;
|
||||||
handleList.Add(handle);
|
handleList.Add(handle);
|
||||||
|
|
||||||
//开始通过win32激活
|
//显示窗口(最小化的也可以让显示出来)
|
||||||
var showWindow = ShowWindow(handle, 9);
|
var activateForm = ShowWindowAsync(handle, SW_SHOWNOACTIVATE);//显示
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(10000, 20000));
|
||||||
var setActiveWindow = SetActiveWindow(handle);
|
|
||||||
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(1000, 3000));
|
|
||||||
var setForegroundWindow = SetForegroundWindow(handle);
|
|
||||||
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(2000, 5000));
|
|
||||||
|
|
||||||
////找窗口的坐标
|
//设置窗体的位置
|
||||||
//Rect rect = new Rect();
|
var x = new Random(Guid.NewGuid().GetHashCode()).Next(100, 300);
|
||||||
//var getWindowRect = GetWindowRect(handle, out var lpRect);
|
var y = new Random(Guid.NewGuid().GetHashCode()).Next(200, 500);
|
||||||
|
var mobileForm = SetWindowPos(handle, IntPtr.Zero, x, y, 0, 0, 1);
|
||||||
|
|
||||||
////设置鼠标的位置
|
LogHelper.GetSingleObj().Info("激活", $"激活窗口 => 显示窗口:{activateForm};位置=x:{x},y:{y} => {mobileForm};");
|
||||||
//var setCursorPos = SetCursorPos(lpRect.Left + new Random(Guid.NewGuid().GetHashCode()).Next(10, 30), lpRect.Top + new Random(Guid.NewGuid().GetHashCode()).Next(5, 12));
|
Thread.Sleep(1000 * 30);
|
||||||
|
|
||||||
var release = ReleaseCapture();
|
//只操作一个微信窗体,看下会不会出问题
|
||||||
|
break;
|
||||||
int x = new Random(Guid.NewGuid().GetHashCode()).Next(10, 30);
|
|
||||||
int y = new Random(Guid.NewGuid().GetHashCode()).Next(5, 12);
|
|
||||||
var one = SendMessage(handle, 0x201, IntPtr.Zero, new IntPtr(x + (y << 16)));
|
|
||||||
Thread.Sleep(300);
|
|
||||||
var two = SendMessage(handle, 0x202, IntPtr.Zero, new IntPtr(x + (y << 16)));
|
|
||||||
|
|
||||||
//LogHelper.GetSingleObj().Info("激活", $"激活窗口 => showWindow:{showWindow};setActiveWindow={setActiveWindow};setForegroundWindow={setForegroundWindow};getWindowRect={getWindowRect};{JsonConvert.SerializeObject(lpRect)};setCursorPos={setCursorPos};release={release};mouse={sendMessage}");
|
|
||||||
LogHelper.GetSingleObj().Info("激活", $"激活窗口 => showWindow:{showWindow};setActiveWindow={setActiveWindow};setForegroundWindow={setForegroundWindow};release={release};x={x};y={y};one={one};two={two}");
|
|
||||||
Thread.Sleep(2000);
|
|
||||||
} while (true);
|
} while (true);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -489,23 +549,69 @@ namespace PCRobot.Utils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///// <summary>
|
||||||
|
///// 主窗体句柄
|
||||||
|
///// </summary>
|
||||||
|
//public static IntPtr MainExeHandle = IntPtr.Zero;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激活windows窗口
|
/// 激活windows窗口
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ActivateWindow()
|
public static void ActivateWindow()
|
||||||
{
|
{
|
||||||
Task.Factory.StartNew(() =>
|
CloseWeChatUpdateWindow();
|
||||||
{
|
|
||||||
//激活个人微信
|
//激活个人微信
|
||||||
ActivateWindow("WeChatMainWndForPC", "微信");
|
ActivateWindow("WeChatMainWndForPC", "微信");
|
||||||
Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(4000, 10000));
|
//Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(4000, 10000));
|
||||||
//激活企业微信
|
//激活企业微信
|
||||||
ActivateWindow("WeWorkWindow", "企业微信");
|
//ActivateWindow("WeWorkWindow", "企业微信");
|
||||||
});
|
|
||||||
|
//Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(2000, 4000));
|
||||||
|
//ActivateMainForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 激活主窗体
|
||||||
|
/// </summary>
|
||||||
|
private static void ActivateMainForm()
|
||||||
|
{
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// if (MainExeHandle == IntPtr.Zero)
|
||||||
|
// {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ////开始通过win32激活
|
||||||
|
// //var showWindow = ShowWindow(MainExeHandle, 9);
|
||||||
|
// var activateForm = ShowWindowAsync(MainExeHandle, SW_SHOWNOACTIVATE);//显示
|
||||||
|
// Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(1000, 2000));
|
||||||
|
// var setForegroundWindow = SetForegroundWindow(MainExeHandle);
|
||||||
|
// Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(2000, 3000));
|
||||||
|
|
||||||
|
// int x = new Random(Guid.NewGuid().GetHashCode()).Next(10, 30);
|
||||||
|
// int y = new Random(Guid.NewGuid().GetHashCode()).Next(5, 10);
|
||||||
|
// var one = SendMessage(MainExeHandle, 0x201, IntPtr.Zero, new IntPtr(x + (y << 16)));
|
||||||
|
// Thread.Sleep(300);
|
||||||
|
// var two = SendMessage(MainExeHandle, 0x202, IntPtr.Zero, new IntPtr(x + (y << 16)));
|
||||||
|
|
||||||
|
// Thread.Sleep(new Random(Guid.NewGuid().GetHashCode()).Next(2000, 3000));
|
||||||
|
|
||||||
|
// var minNoActive = ShowWindowAsync(MainExeHandle, SW_SHOWMINNOACTIVE);//最小化
|
||||||
|
|
||||||
|
// LogHelper.GetSingleObj().Info("激活", $"激活主程序窗口 => 显示窗口:{activateForm};置顶={setForegroundWindow};点击=>x={x};y={y};最小化窗口={minNoActive};one={one};two={two}");
|
||||||
|
// }
|
||||||
|
// catch (Exception e)
|
||||||
|
// {
|
||||||
|
// Console.WriteLine($"ActivateMainForm Error:{e.Message}\r\n MainExeHandle => {MainExeHandle}");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static string Device = string.Empty;
|
private static string Device = string.Empty;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取设备信息
|
/// 获取设备信息
|
||||||
|
|
|
@ -235,6 +235,12 @@ namespace DYRebate
|
||||||
|
|
||||||
if (e.Member != null)
|
if (e.Member != null)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#region 订单变化通知消息
|
#region 订单变化通知消息
|
||||||
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
||||||
if (robot_info != null)
|
if (robot_info != null)
|
||||||
|
|
|
@ -104,6 +104,12 @@ namespace JDRebate
|
||||||
if (order_jd == null) return;
|
if (order_jd == null) return;
|
||||||
if (e.Member != null)
|
if (e.Member != null)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var robot_info = session.FindRobotInfo(e.Member.robot_name, e.Member.robot_type);
|
var robot_info = session.FindRobotInfo(e.Member.robot_name, e.Member.robot_type);
|
||||||
if (robot_info != null)
|
if (robot_info != null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -97,6 +97,12 @@ namespace KSRebate
|
||||||
|
|
||||||
if (e.Member != null)
|
if (e.Member != null)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#region 订单变化通知消息
|
#region 订单变化通知消息
|
||||||
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
||||||
if (robot_info != null)
|
if (robot_info != null)
|
||||||
|
|
|
@ -49,6 +49,11 @@ namespace MessageSupervises
|
||||||
SDK.WXApplyGroupEvent += SDK_WXApplyGroupEvent;
|
SDK.WXApplyGroupEvent += SDK_WXApplyGroupEvent;
|
||||||
SDK.WXApplyFriendEvent += SDK_WXApplyFriendEvent;
|
SDK.WXApplyFriendEvent += SDK_WXApplyFriendEvent;
|
||||||
SDK.WXNewFriendEvent += SDK_WXNewFriendEvent;
|
SDK.WXNewFriendEvent += SDK_WXNewFriendEvent;
|
||||||
|
|
||||||
|
ApiClient.BlackMemberFunc = () =>
|
||||||
|
{
|
||||||
|
return Config.FrequencyCloudBlack;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -193,6 +198,7 @@ namespace MessageSupervises
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
ApiClient.BlackMemberFunc = null;
|
||||||
if (mainForm != null) //关闭窗体
|
if (mainForm != null) //关闭窗体
|
||||||
{
|
{
|
||||||
mainForm.CloseForm();
|
mainForm.CloseForm();
|
||||||
|
|
|
@ -153,6 +153,12 @@ namespace PDDRebate
|
||||||
|
|
||||||
if (e.Member != null)
|
if (e.Member != null)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var robot_info = session.FindRobotInfo(e.Member.robot_name, e.Member.robot_type);
|
var robot_info = session.FindRobotInfo(e.Member.robot_name, e.Member.robot_type);
|
||||||
|
|
||||||
if (robot_info != null)
|
if (robot_info != null)
|
||||||
|
@ -577,6 +583,7 @@ namespace PDDRebate
|
||||||
order.db_robottype = e.ChatType;
|
order.db_robottype = e.ChatType;
|
||||||
order.msg_groupid = e.Groupid;
|
order.msg_groupid = e.Groupid;
|
||||||
order.db_userid = _member.id;
|
order.db_userid = _member.id;
|
||||||
|
order.db_point = string.Empty;
|
||||||
session.SaveOrUpdate(order);
|
session.SaveOrUpdate(order);
|
||||||
|
|
||||||
if (_member != null)
|
if (_member != null)
|
||||||
|
|
|
@ -99,6 +99,12 @@ namespace SNRebate
|
||||||
{
|
{
|
||||||
if (e.Member != null && e.ChatType == CpsType.苏宁易购)
|
if (e.Member != null && e.ChatType == CpsType.苏宁易购)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var session = ApiClient.GetSession();
|
var session = ApiClient.GetSession();
|
||||||
var order = e.Order as fl_order_suning;
|
var order = e.Order as fl_order_suning;
|
||||||
if (order == null) return;
|
if (order == null) return;
|
||||||
|
|
|
@ -232,6 +232,12 @@ namespace TBRebate
|
||||||
|
|
||||||
if (e.Member != null)
|
if (e.Member != null)
|
||||||
{
|
{
|
||||||
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#region 订单变化通知消息
|
#region 订单变化通知消息
|
||||||
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
var robot_info = session.FindRobotInfo(e.Member.robot_name.Trim(), e.Member.robot_type);
|
||||||
if (robot_info != null)
|
if (robot_info != null)
|
||||||
|
|
|
@ -100,7 +100,11 @@ namespace WPHRebate
|
||||||
{
|
{
|
||||||
if (e.Member != null && e.ChatType == CpsType.唯品联盟)
|
if (e.Member != null && e.ChatType == CpsType.唯品联盟)
|
||||||
{
|
{
|
||||||
//this.OnLog("拼多多订单:" + HttpHelper.ObjectToJson(e));
|
//是否黑名单
|
||||||
|
if (ApiClient.IsBlackFlMemberInfo(e.Member))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var session = ApiClient.GetSession();
|
var session = ApiClient.GetSession();
|
||||||
var order = e.Order as fl_order_weipinhui;
|
var order = e.Order as fl_order_weipinhui;
|
||||||
|
|
|
@ -57,6 +57,26 @@ namespace Api.Framework
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ApiClient
|
public class ApiClient
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static Func<bool> BlackMemberFunc;
|
||||||
|
|
||||||
|
public static bool IsBlackFlMemberInfo(fl_member_info member)
|
||||||
|
{
|
||||||
|
if (member.status != MemberType.白名单)
|
||||||
|
{
|
||||||
|
var isOnOff = BlackMemberFunc?.Invoke() ?? false;
|
||||||
|
if (isOnOff)
|
||||||
|
{
|
||||||
|
CloudBlack cloud = new CloudBlack();
|
||||||
|
if (cloud.QueryBlack(member.username, member.robot_type) != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 插件列表显示的插件
|
/// 插件列表显示的插件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3063,20 +3083,20 @@ namespace Api.Framework
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(tousername))
|
if (!string.IsNullOrWhiteSpace(tousername))
|
||||||
{
|
{
|
||||||
var member = session.FindBlacklistMemberInfos().FirstOrDefault(f => f.username == tousername);
|
//var member = session.FindBlacklistMemberInfos().FirstOrDefault(f => f.username == tousername);
|
||||||
if (member != null) break;
|
//if (member != null) break;
|
||||||
|
|
||||||
var m = session.FindMemberInfoByUsername(tousername);
|
//var m = session.FindMemberInfoByUsername(tousername);
|
||||||
if (m.status != MemberType.白名单)
|
//if (m.status != MemberType.白名单)
|
||||||
{
|
//{
|
||||||
CloudBlack cloud = new CloudBlack();
|
// CloudBlack cloud = new CloudBlack();
|
||||||
if (cloud.QueryBlack(tousername, item.Robot.type) != null)
|
// if (cloud.QueryBlack(tousername, item.Robot.type) != null)
|
||||||
break;
|
// break;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (message.Contains("[昵称]"))
|
if (message.Contains("[昵称]"))
|
||||||
{
|
{
|
||||||
member = session.FindSingle<fl_member_info>("select * from fl_member_info where robot_type = @robot_type and username = @username", new { username = tousername, robot_type = ChatType.QQ });
|
var member = session.FindSingle<fl_member_info>("select * from fl_member_info where robot_type = @robot_type and username = @username", new { username = tousername, robot_type = ChatType.QQ });
|
||||||
if (member != null)
|
if (member != null)
|
||||||
message = message.Replace("[账号]", tousername).Replace("[昵称]", member.usernick);
|
message = message.Replace("[账号]", tousername).Replace("[昵称]", member.usernick);
|
||||||
else
|
else
|
||||||
|
@ -3105,20 +3125,20 @@ namespace Api.Framework
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(tousername))
|
if (!string.IsNullOrWhiteSpace(tousername))
|
||||||
{
|
{
|
||||||
var member = session.FindBlacklistMemberInfos().FirstOrDefault(f => f.username == tousername);
|
//var member = session.FindBlacklistMemberInfos().FirstOrDefault(f => f.username == tousername);
|
||||||
if (member != null) break;
|
//if (member != null) break;
|
||||||
|
|
||||||
var m = session.FindMemberInfoByUsername(tousername);
|
//var m = session.FindMemberInfoByUsername(tousername);
|
||||||
if (m.status != MemberType.白名单)
|
//if (m.status != MemberType.白名单)
|
||||||
{
|
//{
|
||||||
CloudBlack cloud = new CloudBlack();
|
// CloudBlack cloud = new CloudBlack();
|
||||||
if (cloud.QueryBlack(tousername, item.Robot.type) != null)
|
// if (cloud.QueryBlack(tousername, item.Robot.type) != null)
|
||||||
break;
|
// break;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (message.Contains("[昵称]"))
|
if (message.Contains("[昵称]"))
|
||||||
{
|
{
|
||||||
member = session.FindSingle<fl_member_info>("select * from fl_member_info where robot_type = @robot_type and username = @username", new { username = tousername, robot_type = item.Robot.type });
|
var member = session.FindSingle<fl_member_info>("select * from fl_member_info where robot_type = @robot_type and username = @username", new { username = tousername, robot_type = item.Robot.type });
|
||||||
message = message.Replace("[昵称]", member == null ? string.Empty : member.usernick);
|
message = message.Replace("[昵称]", member == null ? string.Empty : member.usernick);
|
||||||
}
|
}
|
||||||
message = message.Replace("[账号]", tousername);
|
message = message.Replace("[账号]", tousername);
|
||||||
|
|
|
@ -404,6 +404,10 @@ html = {html}");
|
||||||
Postdata = "",
|
Postdata = "",
|
||||||
ResultType = ResultType.String
|
ResultType = ResultType.String
|
||||||
};
|
};
|
||||||
|
|
||||||
|
item.Header.Add("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
|
||||||
|
item.Header.Add("Accept-Encoding", "deflate");
|
||||||
|
|
||||||
HttpResult result = http.GetHtml(item);
|
HttpResult result = http.GetHtml(item);
|
||||||
|
|
||||||
string html = result.Html;
|
string html = result.Html;
|
||||||
|
|
|
@ -118,6 +118,12 @@ namespace Api.Framework.Timers
|
||||||
var isFirstOrder = false;//是否获得用户首单奖励
|
var isFirstOrder = false;//是否获得用户首单奖励
|
||||||
var islotUserQuery = false;//订单是否为多人查询
|
var islotUserQuery = false;//订单是否为多人查询
|
||||||
|
|
||||||
|
|
||||||
|
if (isFrontData)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//订单自动绑定
|
//订单自动绑定
|
||||||
if (db_order.db_userid == 0 && ApiClient.Setting.SystemConfig.order_pinduoduo_bind == SwitchType.开启)
|
if (db_order.db_userid == 0 && ApiClient.Setting.SystemConfig.order_pinduoduo_bind == SwitchType.开启)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue