随笔分类 -  C#

C#
摘要:WPF 异步执行 Action<> Func<> https://www.cnblogs.com/vipsoft/p/4535037.html C# 异步 this.BeginInvoke 、Task.Run 或 Thread: https://www.cnblogs.com/vipsoft/p/1 阅读全文
posted @ 2023-10-20 16:11 VipSoft 阅读(50) 评论(0) 推荐(0)
摘要:C# 使用 DbDataReader 来访问数据库 使用SqlDataAdapter和DataSet来访问数据库 报:已有打开的与此 Command 相关联的 DataReader,必须首先将它关闭 解决方法,使用 using 包住 connection using System; using Sy 阅读全文
posted @ 2023-10-13 13:20 VipSoft 阅读(189) 评论(0) 推荐(0)
摘要:/// <summary> /// 当前时间是否是值班时间 /// </summary> private bool IsDutyTime { get { var dutyTime = "23:00-07:00"; if (!string.IsNullOrEmpty(dutyTime)) { var 阅读全文
posted @ 2023-10-12 09:58 VipSoft 阅读(34) 评论(0) 推荐(0)
摘要:.NET Core 在其上下文中,该请求的地址无效。 看了端口,发现没被占用,后来发现是IP地址变了 改成正确的IP就可以了。 阅读全文
posted @ 2023-09-11 13:38 VipSoft 阅读(773) 评论(0) 推荐(1)
摘要:没成功,只是做个记录,后面再研究 希望将第三方的 HandyControl.dll 嵌入到 exe 中,这样不用发多个文件给别人 ![image](https://img2023.cnblogs.com/blog/80824/202308/80824-20230804153348542-538869 阅读全文
posted @ 2023-08-10 08:58 VipSoft 阅读(554) 评论(0) 推荐(0)
摘要:目录说明设置提醒时间,及休息时间久坐提醒倒计时休息提醒倒计时休息到计时代码说明主窗体设置工作到计时休息倒计时安装包&源码高清图 久坐提醒桌面小程序: 干这行职业病比较多,之前用爱丽(即:玻璃酸钠滴眼液),用的时候挺舒服,缓解吧,不过治标不治本。 注意休息,加强锻炼非常有必要,每工作1小时,休息10分 阅读全文
posted @ 2023-08-08 09:01 VipSoft 阅读(5653) 评论(35) 推荐(41)
摘要:[TOC] ![image](https://img2023.cnblogs.com/blog/80824/202302/80824-20230201133344225-1260068838.png) ## 类的表示(Class) 第一层:显示类的名称,如果是抽象类,则就用斜体显示。 第二层:是类的 阅读全文
posted @ 2023-07-27 19:44 VipSoft 阅读(2103) 评论(0) 推荐(3)
摘要:Visual Studio 为多环境配置 Web.config 不同的环境,存在不同的配置,如:数据库连接字符串,通过多配置,方便做环境切换,配置的修改 阅读全文
posted @ 2023-07-11 10:05 VipSoft 阅读(2064) 评论(7) 推荐(19)
摘要:说明: 在处理向该请求提供服务所需的配置文件时出错。请检查下面的特定错误详细信息并适当地修改配置文件。 分析器错误消息: 未能找到 CodeDom 提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider 阅读全文
posted @ 2023-04-10 14:19 VipSoft 阅读(1901) 评论(0) 推荐(0)
摘要:静态资源( StaticResource )指的是在程序载入内存时对资源的一次性使用,之后就不再访问这个资源了;动态资源(DynamicResource)使用指的是在程序运行过程中然会去访问资源。 简单的可以理解为,如果换皮肤而不重启程序,就需要用 DynamicResource <Window x 阅读全文
posted @ 2022-09-29 14:43 VipSoft 阅读(460) 评论(0) 推荐(0)
摘要:画一个 Border 对边框进行投影 <Window x:Class="WpfApp1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.micr 阅读全文
posted @ 2022-09-28 12:32 VipSoft 阅读(197) 评论(0) 推荐(0)
摘要:要注意,拖拽的地方,需要加背景色,否则 DrageMove 将无效 MainWindows.xaml <Window x:Class="Report.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentatio 阅读全文
posted @ 2022-09-28 09:46 VipSoft 阅读(728) 评论(0) 推荐(1)
摘要:C# //创建一个长度为10的byte数组,并且其中每个byte的值为0x08. byte[] myByteArray = Enumerable.Repeat((byte)0x08, 10).ToArray(); byte[] res= Enumerable.Range(1, 1000).Selec 阅读全文
posted @ 2022-08-10 11:51 VipSoft 阅读(379) 评论(0) 推荐(0)
摘要:常用方法: public class FileHelper { /// <summary> /// 用得比较多 /// </summary> /// <param name="msg"></param> public static void WriteAppend(string msg) { Sys 阅读全文
posted @ 2022-07-13 14:26 VipSoft 阅读(272) 评论(0) 推荐(0)
摘要:C# 和 java 基本数据类型 C#类型 java类型 描述 默认值 bool boolean 布尔值 False byte byte 8 位无符号整数 0 char char 16 位 Unicode 字符 '\0' decimal BigDecimal(非基本) 128 位精确的十进制值,28 阅读全文
posted @ 2022-07-01 08:58 VipSoft 阅读(347) 评论(0) 推荐(0)
摘要:在DataGrid中实现Button Command绑定 Command="{Binding editCommand}" 会默认查找UserList中对象的属性,而你的UserList中对象应该不包括editCommand属性;可以尝试:Command="{Binding DataContext.e 阅读全文
posted @ 2022-06-01 14:15 VipSoft 阅读(251) 评论(0) 推荐(0)
摘要:C# CRC8 C# /// /// This enum is used to indicate what kind of checksum you will be calculating. /// public enum CRC8_POLY { CRC8 = 0xd5, CRC8_CCITT = 阅读全文
posted @ 2022-05-06 23:31 VipSoft 阅读(554) 评论(0) 推荐(0)
摘要:VS 2019 目标框架中没有 .NET Core 3.X、.Net 5.0 https://dotnet.microsoft.com/download/dotnet-core/3.0 Visual Studio 2019 (v16.3 or later) 原因: VS2019需要 v16.3 版本 阅读全文
posted @ 2022-03-22 10:31 VipSoft 阅读(1322) 评论(0) 推荐(0)
摘要:NLog.confg 参考配置, NLog 热生效不需要重启服务 <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http:// 阅读全文
posted @ 2021-12-28 12:30 VipSoft 阅读(1289) 评论(0) 推荐(0)
摘要:通过日志,记录每个接口请求的耗时情况 结合 <logger name="*" level="Trace" writeTo="tracefile"/> 配置使用,NLog 热生效不需要重启服务 增加 RequestLogMiddleware.cs public class RequestLogMidd 阅读全文
posted @ 2021-12-28 11:58 VipSoft 阅读(521) 评论(0) 推荐(0)