拆分按钮样式

This commit is contained in:
wule committed 2026-06-15 20:48:52 +08:00
1 parent d03a1e1466
commit 167885814e
37 files changed
+1009 -219

No files matched your search

+126 -21
View File
@@ -1,13 +1,21 @@
using AllBase;
using _29WxOrderWpf.BaseWindows;
using _29WxOrderWpf.OrderCtrls;
using AllBase;
using AllBase.Extension;
using AllBase.Model;
using NaiBa.Util;
using NaiBa.Util.Extension;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -18,21 +26,19 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Work;
namespace _29WxOrderWpf
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
public partial class MainWindow : BaseWindow
{
public ObservableCollection<oms_wei_order_info> lstOrder { get; set; } = new ObservableCollection<oms_wei_order_info>();
public List<oms_wei_order_info> lstOrder1 { get; set; } = new List<oms_wei_order_info>();
public MainWindow()
{
InitializeComponent();
//DataContext = this;
this.DataContext = this;
this.Height = 800;
this.Width = 1600;
@@ -40,31 +46,130 @@ namespace _29WxOrderWpf
private void Window_Loaded(object sender, RoutedEventArgs e)
{
//MyData newItem = new MyData { Name = "New Person", Age = 28 }; // 创建新数据项
//_myDataCollection.Add(newItem); // 添加到集合中
//dataGrid.Items.Refresh();.
//dgOrder.Items.Add(1111111);
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
dgOrder.ItemsSource = lstOrder;
#region 弹出登录窗口
LoginWindows.LoginWindow loginWindow = new LoginWindows.LoginWindow();
loginWindow.Owner = this;
loginWindow.ShowDialog();
#endregion
}
lbxOrder.ItemsSource = lstOrder;
for (int i = 0; i < 10000; i++)
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
}
#region 反抓包功能
private void AutoAntiGrabbingMechanism()
{
while (true)
{
//lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = ("3737033423685556736".ParseToLong() + Randomx.GetId(0,100)).ParseToString(), shop_name = "媛卡曦工厂优选" });
lstOrder.Add(new oms_wei_order_info() { id = 1, is_select = false, order_id = Randomx.GetId(1000,10000).ParseToString(), shop_name = "媛卡曦工厂优选" });
#if DEBUG
#else
AntiGrabbingMechanism();
#endif
try { Thread.Sleep(3000); } catch { }
}
lstOrder.SortDesc(o => o.order_id.ParseToLong());
}
private void btnClose_Click(object sender, RoutedEventArgs e)
[DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool IsWow64Process([In] IntPtr process, [Out] out bool wow64Process);
private List<string> _AntiProcesses = "WINRAR,WIRESHARK,FIDDLER,HTTPDEBUGGERPRO,IEHTTPANALYZER,CHARLES,HTTPWATCH,SMARTSNIFF,MINISNIFFER,PROXIFIER,HTTP ANALYZER,SNIFFER,WSOCKEXPERT,IPANALYSE,ANALYZER,HTTP ANALYZER STAND-ALONE EDITION".Split(',').ToList();
private void AntiGrabbingMechanism()
{
this.Close();
//Gate 1 - Anti Proxy
if (IsUseSystemProxy())
{
LockUserAndKillProcess();
}
//Gate 2 - Anti Special Processes
System.Diagnostics.Process[] processList = System.Diagnostics.Process.GetProcesses();
foreach (System.Diagnostics.Process process in processList)
{
try
{
if (_AntiProcesses.Contains(process.ProcessName.ToUpper()))
{
process.Kill();
LockUserAndKillProcess();
}
if (process.MainWindowTitle.Contains("正在捕获"))
{
process.Kill();
LockUserAndKillProcess();
}
if (!IsWin23App(process))
{
continue;
}
if (process.MainModule?.FileVersionInfo.FileDescription != null)
{
foreach (string antiProcess in _AntiProcesses)
{
if (process.MainModule.FileVersionInfo.FileDescription.ToUpper().Contains(antiProcess))
{
process.Kill();
LockUserAndKillProcess();
}
}
}
}
catch (Exception e)
{
}
}
}
private void Path_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
private void LockUserAndKillProcess()
{
var orderId = ((sender as Border)?.Tag).ParseToString();
Clipboard.SetText(orderId);
string url = BaseClass.BuildObjString("user&act=add_user_lock");
string data = UserLogin.GetSignaturex("", "");
string html = GetHtml.PostUtf8(url, data);
Process.GetCurrentProcess().Kill();
}
public static bool IsUseSystemProxy()
{
BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic;
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
FieldInfo field1 = systemWebProxy.GetType().GetField("webProxy", bindingAttr);
if (field1 != (FieldInfo)null)
{
WebProxy webProxy = field1.GetValue((object)systemWebProxy) as WebProxy;
FieldInfo field2 = webProxy.GetType().GetField("_ProxyHostAddresses", bindingAttr);
if (field2 != (FieldInfo)null)
{
Hashtable hashtable = field2.GetValue((object)webProxy) as Hashtable;
if (hashtable != null && hashtable.Count > 0)
return true;
}
}
return false;
}
public bool IsWin23App(Process process)
{
if (Environment.Is64BitOperatingSystem)
{
IntPtr processHandle;
bool retVal;
try
{
processHandle = Process.GetProcessById(process.Id).Handle;
}
catch
{
return false;
}
return IsWow64Process(processHandle, out retVal) && retVal;
}
return true;
}
#endregion
}
}