随笔分类 - C#
摘要:1. 安装 Microsoft.AspNetCore.SignalR 2. 配置 SignalR 服务 public class RandomNumberHub : Hub { /// <summary> /// 前端推送到后端 /// </summary> public async Task Se
阅读全文
摘要:我的建议是: 是 是 是不适用Label标签,使用 TextBlock <TextBlock > <Run Text="今天已上传"></Run><Run Text="{Binding TodayOkNum}"/><Run Text="条,失败"/> <Run Text="{Binding Toda
阅读全文
摘要:1. 整型 转 高低字节 /// <summary> /// 将整数转换为高字节在前,低字节在后的字节数组 /// </summary> static byte[] IntToHighLowBytes(int value) { if (value < 0 || value > 0xFFFF) thr
阅读全文
摘要:1.Xaml <Border BorderBrush="#DDDDDD" BorderThickness="1" CornerRadius="5" Background="#001c33"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Widt
阅读全文
摘要:一:常规版 方法A实现了AAAAA...循环执行,且做到A和A之间的时间间隔相同 using System.Diagnostics; using System.Runtime.InteropServices; namespace App10 { internal class Program { pr
阅读全文
摘要:1.编辑Xaml时,选择“设计”选项卡 2.右键单击该按钮,然后选择“编辑模板/编辑副本/应用程序” 3.标签就会多了Key,根据Key去App.xaml中注释悬浮中的代码
阅读全文
摘要:1.在你的工程中,添加app.config文件。文件的内容默认为: <?xml version="1.0" encoding="utf-8" ?> <configuration> </configuration> 2.如果你想给程序配置一些参数,就在标签中添加.例如: <?xml version="
阅读全文
摘要:1.资源 <Window.Resources> <Style x:Key="TabStyle" TargetType="TabItem"> <Setter Property="TextBlock.FontSize" Value="12" /> <Setter Property="Template">
阅读全文
摘要:绿色部分可以动态调整高度: <Grid Height="450" Width="800"> <Viewbox> <Canvas Width="20" Height="20"> <Path Data="M5.39285714,9.10714286 L5.39285714,9.64285714 C5.3
阅读全文
摘要:1.VS中右键App.xaml,【生成操作】选择为【Page】 2.修改App.xaml.cs文件如下: using System; using Microsoft.Extensions.DependencyInjection; using System.Threading; using Syste
阅读全文
摘要:<ItemsControl ItemsSource="{Binding MemberList}" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling" Vi
阅读全文
摘要:这个鱼真舒服呀~ 1.Invoke 是一个方法,方法一定要用对象来调用 2.使用 Invoke 的两种情况,控件 Control.Invoke 和 委托 Delegate.Invoke 3.控件情况下,解决跨线程访问控件,例如操作 Lable 控件添加内容,使用 able.Invoke 即可 4.委
阅读全文
摘要:public void SaveLensDisRet(string fileContent) { var filePath = Directory.GetCurrentDirectory() + "\\data\\LensDisRet\\"; if (!Directory.Exists(filePa
阅读全文
摘要:许久没有发表这么有含金量的博客,深感欣慰。
阅读全文
摘要:class Program { [DllImport("user32.dll")] public static extern int DeleteMenu(IntPtr hMenu, int nPosition, int wFlags);// 删除菜单 [DllImport("user32.dll"
阅读全文
摘要:2022.5.1今天加班 Base64->图片 byte[] bit = Convert.FromBase64String(ret.data.oauthMPCode); using (MemoryStream ms = new MemoryStream(bit)) { Bitmap bmp = ne
阅读全文
摘要:using System; using System.Collections.Generic; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine("(54/10):{
阅读全文
摘要:1、Json转换为XML XmlDocument docj = JsonConvert.DeserializeXmlNode(strJson); string resultText = docj.OuterXml; 2、Xml转换为Json XmlDocument doc = new XmlDocu
阅读全文
摘要:1.需要解析的XML字符串,获取 BookedInfo 集合 string xmlStr = @"<Request> <BookedInfos> <BookedInfo> <CHARGECODE> 收费项编码 </CHARGECODE> <HISDEPTCODE> His科室代码 </HISDEPT
阅读全文

浙公网安备 33010602011771号