随笔分类 - .NET
摘要:通过Blend复制原有样式后修改 <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> <Setter Property="OverridesDefaultStyle" Value="true"/> <Sett
阅读全文
摘要:NAudio var enumerator = new MMDeviceEnumerator(); var devices = enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.All); foreach (var de
阅读全文
摘要:<InkCanvas x:Name="inkCanvas" Background="White" > <InkCanvas.DefaultDrawingAttributes> <!--<DrawingAttributes StylusTip="Ellipse" Height="8" Width="4
阅读全文
摘要:// 克隆一个现有的文化 CultureInfo customCulture = (CultureInfo)CultureInfo.GetCultureInfo("zh-CN").Clone(); // 修改时间显示格式 customCulture.DateTimeFormat.ShortDateP
阅读全文
摘要:前台 <Window x:Class="FinalTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winf
阅读全文
摘要:引用surfer安装后自动添加的com组件 代码调用 using Surfer; Application app = new Application(); var path = AppDomain.CurrentDomain.BaseDirectory; app.GridData2(DataFile
阅读全文
摘要:安装nuget【Ude.NetStandard】 using (FileStream fs = File.OpenRead(ParseFilePath)) { Ude.CharsetDetector cdet = new Ude.CharsetDetector(); cdet.Feed(fs); c
阅读全文
摘要:创建两个项目,wpf、webapi 将webapi项目输出类型设置为类库 在wpf中引用webapi wpf中启动 Host.CreateDefaultBuilder(new string[]{ "--urls", "http://localhost:8888", }) .ConfigureWebH
阅读全文
摘要:webview2设置过滤器 //进行网址过滤 //webView.CoreWebView2.AddWebResourceRequestedFilter("http://test.com:8080/xx", CoreWebView2WebResourceContext.All); webView.Co
阅读全文
摘要:视频录制 安装nuget 【System.Runtime.InteropServices】 public class EnumDevices { /// <summary> /// 枚举视频设备 /// </summary> public static IEnumerable<string> Dev
阅读全文
摘要:<hc:NotifyIcon Text="xxxx程序" Visibility="Collapsed" Name="notifyIcon" Icon="/Assets/Ico/title.ico" Click="NotifyIcon_Click" MouseRightButtonDown="noti
阅读全文
摘要:屏蔽ssl验证即可 Browser.RequestHandler = new ExampleRequestHandler(); public class ExampleRequestHandler : RequestHandler { protected override bool OnCertif
阅读全文
摘要:注意参数是否存在null值 var json = JsonConvert.SerializeObject(dto); var dic = JsonConvert.DeserializeObject<Dictionary<string, object>>(json); foreach (var ite
阅读全文
摘要:引入需要的接口 /// <summary> /// 查找窗口 /// </summary> /// <param name="hwnd">窗口句柄</param> /// <param name="title">窗口标题</param> /// <returns></returns> [DllImp
阅读全文
摘要:using Microsoft.Win32; using System; using System.Reflection; namespace Boaway.Platform.DataCollection.Client.Helper { public static class AutoStartHe
阅读全文
摘要:public static class ShortCutHelper { public static string linkTilte = Assembly.GetExecutingAssembly().GetName().Name; public static string lnkFullPath
阅读全文
摘要:private static void InjectResourcePath(WebApplication app, string path, string requestPath) { var provider = new FileExtensionContentTypeProvider(); p
阅读全文
摘要:public class MessageEx { /// <summary> /// 定义数据暂存 /// </summary> private static readonly Dictionary<string, List<Action<object>>> _handlers = new(); /
阅读全文
摘要:备注 核心原理是通过winlogin程序获取其访问令牌随后通过CreateProcessAsUser绕过UAC 普通程序直接启动即可,注意程序运行的当前目录,如果不好改源码可以通过cmd切换目录再执行。 部分情况下可以通过配置服务的登录属性打开允许服务与桌面交互即可,特殊情况下再使用本文的方法。 使
阅读全文
摘要:避免使用WindowChrome.WindowChrome 可能会导致窗口全屏时无法完全遮挡底部窗口 避免使用窗口透明,可能会导致webview、视频组件无法显示 注意检测https证书问题,可以查看win7根证书问题相关解决方法
阅读全文