摘要: 一、以App扩展方法检查进程名和进程ID的方式 1 Public static T SetSingleProcess(this T app)Where T:Application 2 { 3 var process=Process.GetProcesses().Where(p=>p.ProcessN 阅读全文
posted @ 2023-07-11 20:40 follow_discoverer 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 服务端代码 TcpListener tcpListener=new TcpListener(IPAddress.Parse("192.168.1.1"),9000); tcpListener.Start();//启动服务 While(true) { TcpClient tcpClient=tcpLi 阅读全文
posted @ 2023-06-29 13:43 follow_discoverer 阅读(90) 评论(0) 推荐(0) 编辑
摘要: xaml中代码: <Canvas > <ContentPresenter Content="{Binding Canvas}"/> </Canvas> 在对应的ViewModel类中添加属性Canvas即可 阅读全文
posted @ 2023-06-25 20:33 follow_discoverer 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 获取网卡IP地址代码如下: var address=System.Net.Dns.GetHostAddresses(Dns.GetHostName()).Where(m=>m.IsIPv6LinkLocal==false).Select(m=>m.ToString()).ToList(); retu 阅读全文
posted @ 2023-06-13 16:14 follow_discoverer 阅读(57) 评论(0) 推荐(0) 编辑
摘要: PerformanceCounter performanceCounter = new PerformanceCounter("Process", "Working Set - Private", Process.GetCurrentProcess().ProcessName);var result 阅读全文
posted @ 2023-06-13 16:05 follow_discoverer 阅读(12) 评论(0) 推荐(0) 编辑
摘要: <WebBrowser Source="https://www.cnblogs.com/follow-discoverer/p/17431492.html" /> 我这边的问题是主窗口界面设置了AllowTransparent=true,去掉这行代码,改用Resizemode=”CanResizeW 阅读全文
posted @ 2023-05-25 15:41 follow_discoverer 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 直接上代码 public void ChangeColorStyle() { ResourceDictionary resource=new ResourceDictionary(); for(int i=0;i<Appliation.Current.Resources.MegedDictionar 阅读全文
posted @ 2023-05-05 22:06 follow_discoverer 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 public static void ExportToPng(this Canvas canvas,Uri path) 2 { 3 if(path==null) 4 { 5 return; 6 } 7 Transform transform =canvas.LayoutTransform; 8 阅读全文
posted @ 2023-04-27 18:26 follow_discoverer 阅读(317) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="./js/vue.js"></script> <style scoped lang='scss'> </style> </head> < 阅读全文
posted @ 2023-03-18 14:33 follow_discoverer 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 可在在windows系统中搜索event找到事件查看器,进入事件查看器,在windows日志目录下,点击应用程序。在右边的事件列表中找到事件ID为1026的即为.net Runtime错误。 阅读全文
posted @ 2023-03-04 10:49 follow_discoverer 阅读(74) 评论(0) 推荐(0) 编辑