.Net快速掌握完整的MQTT客户端对接

摘要: 1 引用Nuget包 MQTTnet.Extensions.ManagedClient 2 整体客户端大致结构 3 定义日志基类 ModuleLogBase 以及实现基类的MqttClientLog using System; namespace LinseerCopilot.Service.Mqt 阅读全文
posted @ 2025-08-15 11:14 TanZhiWei 阅读(74) 评论(0) 推荐(1)

WPF检测TextBlock 显示不全悬壶提示ToolTip

摘要: Measure测量检测 效果如下: 1 设计转换器检测 public class TrimmedTextBlockVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, 阅读全文
posted @ 2025-08-14 10:27 TanZhiWei 阅读(21) 评论(0) 推荐(0)

WPF应用托盘操作

摘要: 托盘退出包括:托盘定制UI、托盘显示位置、关闭托盘菜单、窗体关闭、资源释放、应用退出 1托盘定制UI(Styles.ContextMenu.xaml) <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/pr 阅读全文
posted @ 2025-08-13 15:13 TanZhiWei 阅读(23) 评论(0) 推荐(0)

自定义Windows消息机制通信

摘要: 自定义Windows消息机制,解决进程间通信 1 自定义Windows消息 internal class WindowMessageSendService { pravite const string WindowsTitle="灵犀助手"; /// <summary> /// 发送显示灵犀助手消息 阅读全文
posted @ 2025-08-13 09:55 TanZhiWei 阅读(11) 评论(0) 推荐(0)

全局钩子监听鼠标和键盘消息

摘要: using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Windows.Forms; namespace Service { public class HookExUtils 阅读全文
posted @ 2025-08-12 17:54 TanZhiWei 阅读(13) 评论(0) 推荐(0)

获取鼠标点击屏幕DPI

摘要: 主窗体DPI、鼠标所在屏幕的DPI 1 开启DPI感知app.manifest <!-- 指示该应用程序可感知 DPI 且 Windows 在 DPI 较高时将不会对其进行 自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需 选择加入。 阅读全文
posted @ 2025-08-12 17:14 TanZhiWei 阅读(18) 评论(0) 推荐(0)

Win11网络受限自动断开

摘要: 在Win11版本上(Win10 无此策略)添加了网络受限自动断开机制,导致已连接的网络被断开。这种行为往往不是客户端需要的。可采用修改注册表关闭网络受限自动断开机制修改注册表(路径 \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc,添加项 EnableBad 阅读全文
posted @ 2025-08-11 10:07 TanZhiWei 阅读(21) 评论(0) 推荐(0)

深入解析:使用C#自定义Windows任务栏图标与应用程序标识

摘要: 偶现安装完成后自启动状态栏应用图标错误 在Windows应用程序开发中,任务栏图标和应用程序标识是用户体验的重要组成部分。通过合理设置这些元素,开发者可以提升应用程序的专业性和用户友好度。本文将详细介绍如何使用C#和Windows API来自定义任务栏图标和应用程序标识,包括技术原理、实现步骤和最佳 阅读全文
posted @ 2025-08-08 11:40 TanZhiWei 阅读(99) 评论(0) 推荐(0)

C#实现窗口禁止固定到任务栏的完整指南

摘要: 转载好友:https://www.cnblogs.com/wuty/p/19027532 在Windows应用程序开发中,有时我们需要控制窗口的某些系统级行为,比如禁止用户将应用程序窗口固定到任务栏。本文将详细介绍如何使用C#和Windows API实现这一功能,并深入解析相关技术原理 默认状态 通 阅读全文
posted @ 2025-08-08 11:03 TanZhiWei 阅读(15) 评论(0) 推荐(0)

FFmpeg.AutoGen 获取注册的编解码类型

摘要: 使用FFmpeg.AutoGen 获取注册的编解码类型 1 获取版本 Debug.WriteLine($"FFmpeg version info: {ffmpeg.av_version_info()}"); FFmpeg version info: 6.0-full_build-www.gyan.d 阅读全文
posted @ 2024-12-18 14:43 TanZhiWei 阅读(142) 评论(0) 推荐(0)