A: 添加网络相关工具类 (NetUtils, SysInfoUtils) 及模型 (NetInfo)
A: 新增网络事件捕获及诊断功能支持 (TCP/UDP 连接、进程信息获取) U: 更新项目引用,Shell 添加对 Infrastructure 的依赖 U: 优化 WebPanel 消息处理逻辑,支持多种新指令 (GetNetInfo 等) U: 调整 ClientApp 中 WinDivertCommand.vue 的接口调用逻辑 D: 移除 Core 项目及相关配置
This commit is contained in:
1 parent
b14594ffb3
commit
0feeb00fae
11 files changed
+556
-29
No files matched your search
@@ -1,25 +1,28 @@
|
||||
<script setup lang="ts">
|
||||
import CommandManager from '@/components/CommandManager.vue'
|
||||
import type { CommandType } from '@/types/command'
|
||||
import {onMounted,onUnmounted} from 'vue'
|
||||
import CSharpBridgeV2 from "@/correspond/CSharpBridgeV2"
|
||||
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
import CSharpBridgeV2 from '@/correspond/CSharpBridgeV2'
|
||||
|
||||
const bridge = CSharpBridgeV2.getBridge()
|
||||
bridge.listen("showMessage",(data) => {
|
||||
console.log('11111111',data);
|
||||
bridge.listen('showMessage', (data) => {
|
||||
console.log('11111111', data)
|
||||
})
|
||||
|
||||
function func() {
|
||||
console.log('点击anniu')
|
||||
|
||||
bridge.send('showMessage',{
|
||||
title: "来自前端的问候",
|
||||
content: "Hello C#!"
|
||||
},(data) => {
|
||||
console.log(data,'======');
|
||||
console.log(window.externalFunctions.__BRIDGE_LISTEN__FUNCTIONS__);
|
||||
})
|
||||
bridge.send(
|
||||
'showMessage',
|
||||
{
|
||||
title: '来自前端的问候',
|
||||
content: 'Hello C#!',
|
||||
},
|
||||
(data) => {
|
||||
console.log(data, '======')
|
||||
console.log(window.externalFunctions.__BRIDGE_LISTEN__FUNCTIONS__)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
const commands: CommandType[] = [
|
||||
@@ -32,19 +35,43 @@ const commands: CommandType[] = [
|
||||
label: '标题',
|
||||
type: 'text',
|
||||
value: 'Vue',
|
||||
placeholder: 'text'
|
||||
},{
|
||||
placeholder: 'text',
|
||||
},
|
||||
{
|
||||
name: 'content',
|
||||
label: '标题',
|
||||
type: 'text',
|
||||
value: 'Hello C#!',
|
||||
placeholder: 'text'
|
||||
placeholder: 'text',
|
||||
},
|
||||
],
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
name: 'GetNetInfo',
|
||||
description: 'GetNetInfo!!',
|
||||
params: [],
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
name: 'GetProgramDiagnostics',
|
||||
description: 'GetProgramDiagnostics!!',
|
||||
params: [],
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
name: 'InspectProcess',
|
||||
description: 'InspectProcess!!',
|
||||
params: [],
|
||||
result: null,
|
||||
},
|
||||
{
|
||||
name: 'GetAllTcpConnections',
|
||||
description: 'GetAllTcpConnections!!',
|
||||
params: [],
|
||||
result: null,
|
||||
},
|
||||
]
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
namespace Infrastructure;
|
||||
using Microsoft.Diagnostics.Tracing.Parsers;
|
||||
|
||||
namespace Infrastructure;
|
||||
using System;
|
||||
using Microsoft.Diagnostics.Tracing;
|
||||
using Microsoft.Diagnostics.Tracing.Parsers.Kernel;
|
||||
using Microsoft.Diagnostics.Tracing.Session;
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,4 +6,8 @@
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.21" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,155 @@
|
||||
namespace Infrastructure.Models;
|
||||
|
||||
public class D
|
||||
{
|
||||
/// <summary>
|
||||
/// 网络信息
|
||||
/// </summary>
|
||||
public List<NetInfo> NetInfos { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进程名称
|
||||
/// </summary>
|
||||
public string ProcessName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 进程ID
|
||||
/// </summary>
|
||||
public int ProcessId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启动时间
|
||||
/// </summary>
|
||||
public DateTime StartTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否退出
|
||||
/// </summary>
|
||||
public bool HasExited { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退出时间
|
||||
/// </summary>
|
||||
public DateTime ExitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 退出代码
|
||||
/// </summary>
|
||||
public int ExitCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 占用内存
|
||||
/// </summary>
|
||||
public string UseMemory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线程数
|
||||
/// </summary>
|
||||
public int ThreadCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 主模块路径
|
||||
/// </summary>
|
||||
public string? MainModulePath { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 启动文件名
|
||||
/// </summary>
|
||||
public string? MainModuleName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件描述
|
||||
/// </summary>
|
||||
public string? FileDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 产品名称
|
||||
/// </summary>
|
||||
public string? ProductName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 公司名称
|
||||
/// </summary>
|
||||
public string? CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
/// </summary>
|
||||
public string? Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版权
|
||||
/// </summary>
|
||||
public string? Copyright { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 网络信息
|
||||
/// </summary>
|
||||
public class NetInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 进程 ID
|
||||
/// </summary>
|
||||
public int Pid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线程 ID
|
||||
/// </summary>
|
||||
public int Tid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 数据方向 "Send" / "Recv"
|
||||
/// </summary>
|
||||
public string Direction { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 初次一次活动事件
|
||||
/// </summary>
|
||||
public DateTime FirstSeen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 最近一次活动事件
|
||||
/// </summary>
|
||||
public DateTime LastSeen { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接状态
|
||||
/// </summary>
|
||||
public int State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 源 IP
|
||||
/// </summary>
|
||||
public string SourceIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 源端口
|
||||
///</summary>
|
||||
public int SourcePort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标 IP
|
||||
///</summary>
|
||||
public string DestIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 目标端口
|
||||
///</summary>
|
||||
public int DestPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 协议 TCP / UDP
|
||||
///</summary>
|
||||
public string Protocol { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 发送字节数
|
||||
/// </summary>
|
||||
public long TotalSendBytes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 接收字节数
|
||||
/// </summary>
|
||||
public long TotalRecvBytes { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Infrastructure.utils;
|
||||
|
||||
using Microsoft.Diagnostics.Tracing.Parsers;
|
||||
using System;
|
||||
using Microsoft.Diagnostics.Tracing;
|
||||
using Microsoft.Diagnostics.Tracing.Parsers.Kernel;
|
||||
using Microsoft.Diagnostics.Tracing.Session;
|
||||
|
||||
public class NetUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// 联网内容监视
|
||||
/// </summary>
|
||||
public static void GetNetInfo()
|
||||
{
|
||||
if (TraceEventSession.IsElevated() == false)
|
||||
{
|
||||
Console.WriteLine("请以管理员身份运行此程序。");
|
||||
return;
|
||||
}
|
||||
|
||||
using (var session = new TraceEventSession("NetTraceSession"))
|
||||
{
|
||||
// 启用 Kernel 网络事件
|
||||
session.EnableKernelProvider(
|
||||
KernelTraceEventParser.Keywords.NetworkTCPIP);
|
||||
|
||||
Console.WriteLine("监听网络事件中(按 Ctrl+C 停止)...");
|
||||
session.Source.Kernel.TcpIpConnect += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[TCP Connect] PID={data.ProcessID} {data.saddr}:{data.sport} -> {data.daddr}:{data.dport}");
|
||||
};
|
||||
session.Source.Kernel.TcpIpDisconnect += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[TCP Disconnect] PID={data.ProcessID} {data.saddr}:{data.sport} -> {data.daddr}:{data.dport}");
|
||||
};
|
||||
session.Source.Kernel.TcpIpSend += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[TCP Send] PID={data.ProcessID} {data.saddr}:{data.sport} -> {data.daddr}:{data.dport}, Size={data.size} bytes");
|
||||
};
|
||||
session.Source.Kernel.TcpIpRecv += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[TCP Recv] PID={data.ProcessID} {data.saddr}:{data.sport} <- {data.daddr}:{data.dport}, Size={data.size} bytes");
|
||||
};
|
||||
session.Source.Kernel.UdpIpSend += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[UDP Send] PID={data.ProcessID} {data.saddr}:{data.sport} -> {data.daddr}:{data.dport}, Size={data.size} bytes");
|
||||
};
|
||||
session.Source.Kernel.UdpIpRecv += data =>
|
||||
{
|
||||
Console.WriteLine(
|
||||
$"[UDP Recv] PID={data.ProcessID} {data.saddr}:{data.sport} <- {data.daddr}:{data.dport}, Size={data.size} bytes");
|
||||
};
|
||||
session.Source.Process(); // 开始监听
|
||||
}
|
||||
}
|
||||
|
||||
private enum TCP_TABLE_CLASS
|
||||
{
|
||||
TCP_TABLE_BASIC_LISTENER,
|
||||
TCP_TABLE_BASIC_CONNECTIONS,
|
||||
TCP_TABLE_BASIC_ALL,
|
||||
TCP_TABLE_OWNER_PID_LISTENER,
|
||||
TCP_TABLE_OWNER_PID_CONNECTIONS,
|
||||
TCP_TABLE_OWNER_PID_ALL, // 我们使用这个
|
||||
TCP_TABLE_OWNER_MODULE_LISTENER,
|
||||
TCP_TABLE_OWNER_MODULE_CONNECTIONS,
|
||||
TCP_TABLE_OWNER_MODULE_ALL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有连接
|
||||
/// </summary>
|
||||
public static void GetAllTcpConnections()
|
||||
{
|
||||
int buffSize = 0;
|
||||
GetExtendedTcpTable(IntPtr.Zero, ref buffSize, true, 2, TCP_TABLE_CLASS.TCP_TABLE_OWNER_PID_ALL, 0);
|
||||
IntPtr tcpTablePtr = Marshal.AllocHGlobal(buffSize);
|
||||
|
||||
try
|
||||
{
|
||||
if (GetExtendedTcpTable(tcpTablePtr, ref buffSize, true, 2, TCP_TABLE_CLASS.TCP_TABLE_OWNER_PID_ALL, 0) ==
|
||||
0)
|
||||
{
|
||||
int rowCount = Marshal.ReadInt32(tcpTablePtr);
|
||||
IntPtr rowPtr = IntPtr.Add(tcpTablePtr, 4);
|
||||
|
||||
for (int i = 0; i < rowCount; i++)
|
||||
{
|
||||
MIB_TCPROW_OWNER_PID row = Marshal.PtrToStructure<MIB_TCPROW_OWNER_PID>(rowPtr);
|
||||
IPAddress localIp = new IPAddress(row.localAddr);
|
||||
IPAddress remoteIp = new IPAddress(row.remoteAddr);
|
||||
int localPort = ntohs((ushort)row.localPort);
|
||||
int remotePort = ntohs((ushort)row.remotePort);
|
||||
|
||||
Console.WriteLine(
|
||||
$"PID: {row.owningPid}, {localIp}:{localPort} -> {remoteIp}:{remotePort}, State: {row.state}");
|
||||
rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_TCPROW_OWNER_PID>());
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(tcpTablePtr);
|
||||
}
|
||||
}
|
||||
|
||||
// 网络字节序转主机字节序
|
||||
private static ushort ntohs(ushort netshort) => (ushort)((netshort >> 8) | (netshort << 8));
|
||||
|
||||
[DllImport("iphlpapi.dll", SetLastError = true)]
|
||||
private static extern uint GetExtendedTcpTable(
|
||||
IntPtr pTcpTable,
|
||||
ref int dwOutBufLen,
|
||||
bool sort,
|
||||
int ipVersion,
|
||||
TCP_TABLE_CLASS tableClass,
|
||||
uint reserved = 0);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MIB_TCPROW_OWNER_PID
|
||||
{
|
||||
public uint state; // 状态:如 ESTABLISHED, LISTENING
|
||||
public uint localAddr; // 本地 IP
|
||||
public uint localPort; // 本地端口(需要字节序转换)
|
||||
public uint remoteAddr; // 远程 IP
|
||||
public uint remotePort; // 远程端口
|
||||
public int owningPid; // 对应的进程 PID
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MIB_TCPTABLE_OWNER_PID
|
||||
{
|
||||
public uint dwNumEntries; // 总连接数
|
||||
public MIB_TCPROW_OWNER_PID table; // 实际连接(数组)
|
||||
}
|
||||
|
||||
|
||||
[DllImport("iphlpapi.dll", SetLastError = true)]
|
||||
private static extern uint GetExtendedUdpTable(
|
||||
IntPtr pUdpTable,
|
||||
ref int dwOutBufLen,
|
||||
bool sort,
|
||||
int ipVersion,
|
||||
UDP_TABLE_CLASS tableClass,
|
||||
uint reserved = 0);
|
||||
|
||||
public enum UDP_TABLE_CLASS
|
||||
{
|
||||
UDP_TABLE_BASIC,
|
||||
UDP_TABLE_OWNER_PID,
|
||||
UDP_TABLE_OWNER_MODULE
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct MIB_UDPROW_OWNER_PID
|
||||
{
|
||||
public uint localAddr; // 本地 IP
|
||||
public uint localPort; // 本地端口(需要字节序转换)
|
||||
public int owningPid; // 进程 PID
|
||||
}
|
||||
|
||||
public static void GetAllUdpListeners()
|
||||
{
|
||||
int buffSize = 0;
|
||||
GetExtendedUdpTable(IntPtr.Zero, ref buffSize, true, 2, UDP_TABLE_CLASS.UDP_TABLE_OWNER_PID, 0);
|
||||
IntPtr udpTablePtr = Marshal.AllocHGlobal(buffSize);
|
||||
|
||||
try
|
||||
{
|
||||
if (GetExtendedUdpTable(udpTablePtr, ref buffSize, true, 2, UDP_TABLE_CLASS.UDP_TABLE_OWNER_PID, 0) == 0)
|
||||
{
|
||||
int rowCount = Marshal.ReadInt32(udpTablePtr);
|
||||
IntPtr rowPtr = IntPtr.Add(udpTablePtr, 4);
|
||||
|
||||
for (int i = 0; i < rowCount; i++)
|
||||
{
|
||||
MIB_UDPROW_OWNER_PID row = Marshal.PtrToStructure<MIB_UDPROW_OWNER_PID>(rowPtr);
|
||||
IPAddress localIp = new IPAddress(row.localAddr);
|
||||
int localPort = ntohs1((ushort)row.localPort);
|
||||
|
||||
Console.WriteLine($"PID: {row.owningPid}, UDP {localIp}:{localPort}");
|
||||
rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_UDPROW_OWNER_PID>());
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Marshal.FreeHGlobal(udpTablePtr);
|
||||
}
|
||||
}
|
||||
|
||||
private static ushort ntohs1(ushort netshort) => (ushort)((netshort >> 8) | (netshort << 8));
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace Infrastructure.utils;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
public static class SysInfoUtils
|
||||
{
|
||||
public static string GetProgramDiagnostics()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
// === 程序自身信息 ===
|
||||
var asm = Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly();
|
||||
sb.AppendLine("=== 程序信息 ===");
|
||||
sb.AppendLine($"程序集名称:{asm.GetName().Name}");
|
||||
sb.AppendLine($"版本号:{asm.GetName().Version}");
|
||||
sb.AppendLine($"路径:{asm.Location}");
|
||||
sb.AppendLine($"启动目录:{AppDomain.CurrentDomain.BaseDirectory}");
|
||||
sb.AppendLine($"命令行参数:{string.Join(" ", Environment.GetCommandLineArgs())}");
|
||||
sb.AppendLine();
|
||||
|
||||
// === 进程运行信息 ===
|
||||
var proc = Process.GetCurrentProcess();
|
||||
sb.AppendLine("=== 进程状态 ===");
|
||||
sb.AppendLine($"进程 ID:{proc.Id}");
|
||||
sb.AppendLine($"进程名称:{proc.ProcessName}");
|
||||
sb.AppendLine($"启动时间:{proc.StartTime}");
|
||||
sb.AppendLine($"运行时长:{DateTime.Now - proc.StartTime}");
|
||||
sb.AppendLine($"线程数:{proc.Threads.Count}");
|
||||
sb.AppendLine($"内存占用:{FormatBytes(proc.WorkingSet64)}");
|
||||
sb.AppendLine();
|
||||
|
||||
// === 系统环境信息 ===
|
||||
sb.AppendLine("=== 系统环境 ===");
|
||||
sb.AppendLine($"操作系统:{RuntimeInformation.OSDescription}");
|
||||
sb.AppendLine($"架构:{(Environment.Is64BitOperatingSystem ? "64位" : "32位")}");
|
||||
sb.AppendLine($"CPU 核心数:{Environment.ProcessorCount}");
|
||||
sb.AppendLine($"机器名:{Environment.MachineName}");
|
||||
sb.AppendLine($"当前用户:{Environment.UserName}");
|
||||
sb.AppendLine();
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static void InspectProcess(int pid)
|
||||
{
|
||||
try
|
||||
{
|
||||
var proc = Process.GetProcessById(pid);
|
||||
|
||||
Console.WriteLine($"进程名称:{proc.ProcessName}");
|
||||
Console.WriteLine($"进程ID:{proc.Id}");
|
||||
Console.WriteLine($"启动时间:{proc.StartTime}");
|
||||
Console.WriteLine($"是否退出:{proc.HasExited}");
|
||||
Console.WriteLine($"退出时间:{proc.ExitTime}");
|
||||
Console.WriteLine($"退出代码:{proc.ExitCode}");
|
||||
Console.WriteLine($"占用内存:{FormatBytes(proc.WorkingSet64)}");
|
||||
Console.WriteLine($"线程数:{proc.Threads.Count}");
|
||||
Console.WriteLine($"主模块路径:{proc.MainModule?.FileName}");
|
||||
Console.WriteLine($"启动文件名:{proc.MainModule?.ModuleName}");
|
||||
var serialize = JsonSerializer.Serialize(proc.MainModule);
|
||||
Console.WriteLine($"YYY:{serialize}");
|
||||
var filePath = proc.MainModule?.FileName;
|
||||
if (filePath != null)
|
||||
{
|
||||
var versionInfo = FileVersionInfo.GetVersionInfo(filePath);
|
||||
|
||||
Console.WriteLine($"文件描述:{versionInfo.FileDescription}");
|
||||
Console.WriteLine($"产品名称:{versionInfo.ProductName}");
|
||||
Console.WriteLine($"公司名称:{versionInfo.CompanyName}");
|
||||
Console.WriteLine($"版本号:{versionInfo.FileVersion}");
|
||||
Console.WriteLine($"版权:{versionInfo.LegalCopyright}");
|
||||
var serialize1 = JsonSerializer.Serialize(versionInfo);
|
||||
|
||||
Console.WriteLine($"XXX:{serialize1}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"获取进程信息失败:{ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private static string FormatBytes(long bytes)
|
||||
{
|
||||
string[] sizes = { "B", "KB", "MB", "GB", "TB" };
|
||||
double len = bytes;
|
||||
int order = 0;
|
||||
while (len >= 1024 && order < sizes.Length - 1)
|
||||
{
|
||||
order++;
|
||||
len /= 1024;
|
||||
}
|
||||
|
||||
return $"{len:0.##} {sizes[order]}";
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shell", "Shell\Shell.csproj", "{9AB85EA6-D0E7-4EE5-9B2E-EA4B71585540}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "Core\Core.csproj", "{B5F4844F-E39B-4FFD-8812-6E2734AEEFBA}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data", "Data\Data.csproj", "{2BBC748F-62F3-4DE3-A4F2-2D483062736C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "Infrastructure\Infrastructure.csproj", "{67448B94-E362-4531-AB18-E7E6D540B579}"
|
||||
@@ -20,10 +18,6 @@ Global
|
||||
{9AB85EA6-D0E7-4EE5-9B2E-EA4B71585540}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9AB85EA6-D0E7-4EE5-9B2E-EA4B71585540}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9AB85EA6-D0E7-4EE5-9B2E-EA4B71585540}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B5F4844F-E39B-4FFD-8812-6E2734AEEFBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5F4844F-E39B-4FFD-8812-6E2734AEEFBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5F4844F-E39B-4FFD-8812-6E2734AEEFBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B5F4844F-E39B-4FFD-8812-6E2734AEEFBA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2BBC748F-62F3-4DE3-A4F2-2D483062736C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2BBC748F-62F3-4DE3-A4F2-2D483062736C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2BBC748F-62F3-4DE3-A4F2-2D483062736C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileVersionInfo_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F7fad91e527c1434bb313ddbc78144605b8a0_003F3f_003F911bc64d_003FFileVersionInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AKernelTraceEventParser_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F25b12134b1124ffbab73641db2e54e5b310830_003F24_003Fd19d02f2_003FKernelTraceEventParser_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ANetworkInterface_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F9c72a65889eb40ae9d8e0f130d1572e0268a0_003F34_003F49f5e6ff_003FNetworkInterface_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AProcess_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4a26a752ec6249c4a090905d31c0cdfa528a0_003F8f_003F7037e590_003FProcess_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AReadOnlyCollectionBase_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4c1fd115dbe5414db1b4da1de3e96c5819910_003F04_003Fcae9fe22_003FReadOnlyCollectionBase_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
|
||||
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AWebView2_002Ecs_002Fl_003AC_0021_003FUsers_003Fcharlatans_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8aca2f2c90e1454c825fc8b69c53a97e14268_003F06_003F22dc0e77_003FWebView2_002Ecs/@EntryIndexedValue">ForceIncluded</s:String></wpf:ResourceDictionary>
|
||||
+2
-2
@@ -7,6 +7,6 @@ namespace Shell;
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,10 @@
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3240.44" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Application\Application.csproj" />
|
||||
<ProjectReference Include="..\Data\Data.csproj" />
|
||||
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -2,6 +2,7 @@ using System.Windows.Controls;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Windows;
|
||||
using Infrastructure.utils;
|
||||
|
||||
namespace Shell.Views;
|
||||
|
||||
@@ -35,10 +36,29 @@ public partial class WebPanel : UserControl
|
||||
|
||||
Console.WriteLine(json);
|
||||
Console.WriteLine(msg?.Channel);
|
||||
if (msg?.Channel == "showMessage")
|
||||
|
||||
switch (msg?.Channel)
|
||||
{
|
||||
MessageBox.Show(msg.Payload?.Content ?? "无内容", msg.Payload?.Title ?? "提示");
|
||||
InitWebView1();
|
||||
case "showMessage":
|
||||
MessageBox.Show(msg.Payload?.Content ?? "无内容", msg.Payload?.Title ?? "提示");
|
||||
InitWebView1();
|
||||
break;
|
||||
case "GetNetInfo":
|
||||
NetUtils.GetNetInfo();
|
||||
break;
|
||||
case "GetProgramDiagnostics":
|
||||
var programDiagnostics = SysInfoUtils.GetProgramDiagnostics();
|
||||
Console.WriteLine(programDiagnostics);
|
||||
break;
|
||||
case "InspectProcess":
|
||||
SysInfoUtils.InspectProcess(23192);
|
||||
break;
|
||||
case "GetAllTcpConnections":
|
||||
NetUtils.GetAllTcpConnections();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("没有任何函数被触发...");
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user