摘要: /// <summary> /// 返回时间差的总时长,以*天*时*分*秒的格式 /// </summary> /// <param name="startTime"></param> /// <param name="overTime"></param> /// <returns></return 阅读全文
posted @ 2024-01-18 10:44 吃奶嘴的路飞 阅读(2) 评论(0) 推荐(0) 编辑
摘要: btnQuery.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)); 阅读全文
posted @ 2023-10-31 10:39 吃奶嘴的路飞 阅读(8) 评论(0) 推荐(0) 编辑
摘要: Graphics currentGraphics = Graphics.FromHwnd(new WindowInteropHelper(Window.GetWindow(this)).Handle); double dpixRatio = currentGraphics.DpiX / 96; 阅读全文
posted @ 2023-09-08 14:43 吃奶嘴的路飞 阅读(130) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 格式化毫秒数 /// </summary> /// <param name="milliseconds"></param> /// <returns></returns> public static string FormatMilliseconds(long m 阅读全文
posted @ 2023-07-26 16:26 吃奶嘴的路飞 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 场景是这样的,对象属性仅只有一个int的扩展字段,新建字段改动太大,所有需要糅合再一个字段里面标示多个属性... 0001 0000 0010 0000 16进制长这样...所以可以利用位来标记不同的属性,还有他们常说的高4位和低4位,例如上面,高4位就是0001,低4位就是0000 假如:高4位的 阅读全文
posted @ 2022-01-12 15:22 吃奶嘴的路飞 阅读(30) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 辅助类 /// </summary> public class HostHelper { /// <summary> /// 尝试附加到托管调试器并断言在当前堆栈运行位置。 /// <para> /// 仅在DEBUG编译条件下生效。 /// </para> // 阅读全文
posted @ 2021-09-30 09:56 吃奶嘴的路飞 阅读(33) 评论(0) 推荐(0) 编辑
摘要: var data = new object[] { new { sn = SN, mac = Mac } }; var jobj = await Task.Run(() => { try { using (HttpClient client = new HttpClient()) { var url 阅读全文
posted @ 2021-09-29 18:08 吃奶嘴的路飞 阅读(37) 评论(0) 推荐(0) 编辑
摘要: new SolidColorBrush((Color)ColorConverter.ConvertFromString("#27212B")) 阅读全文
posted @ 2021-09-16 10:12 吃奶嘴的路飞 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 某些时候命令绑定可能会存在刷新不及时,往往需要点击一次程序才能激活,特此记录下解决方案 System.Windows.Input.CommandManager.InvalidateRequerySuggested(); 阅读全文
posted @ 2021-08-13 09:41 吃奶嘴的路飞 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 控制台、app等桌面应用程序(兼容系统自启) 1 System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) web BS架构 System.AppDomain.CurrentDomain.Base 阅读全文
posted @ 2021-07-16 10:09 吃奶嘴的路飞 阅读(67) 评论(0) 推荐(0) 编辑