• 2024-05-16RDLC降低使用内存
    在Winform使用RDLC时,在批量打印情况下,内存随着打印任务的数量逐渐增加。即便手动GC效果也不明显。原因:localReport在创建时,每个实例都是一个应用程序域。租约的过期时间比较久,按照网上的资料,过期时间大约10分钟左右。这就导致即便打印完了,内存也不会很快下降。解决办法:1.手
  • 2024-04-29C# winform 漂亮的日期时间控件
    源代码下载:https://download.csdn.net/download/gaoxiang19820514/89242240效果图在HZH-Controls控件基础上修改的日期控件因为HZH_Controls控件中的日期控件太大了,我的程序中需要多个日期时间的控件放不下,主题是绿色的,所以手动调了一下样式。为了和HZH_Controls同时使
  • 2024-04-22NET6 Hangfire 可视化配置
    Nuget<PackageReferenceInclude="Hangfire"Version="1.8.5"/><PackageReferenceInclude="Hangfire.AspNetCore"Version="1.8.5"/><PackageReferenceInclude="Hangfire.Console"Version="1
  • 2024-03-26.NET分布式Orleans - 4 - 计时器和提醒
    Timer是什么Timer是一种用于创建定期粒度行为的机制。与标准的.NETSystem.Threading.Timer类相似,Orleans的Timer允许在一段时间后执行特定的操作,或者在特定的时间间隔内重复执行操作。它在分布式系统中具有重要作用,特别是在处理需要周期性执行的任务时非常有用。Timer
  • 2024-02-07C#的timespan怎么使用
    https://www.yisu.com/ask/23316568.html1、TimeSpan类是用来表示时间间隔的,它提供了一些方法和属性来操作和获取时间间隔的信息。以下是一些常用的TimeSpan的用法示例:创建一个TimeSpan实例:TimeSpantimeSpan1=newTimeSpan(2,30,0);//2小时30分钟0秒TimeSpantim
  • 2023-12-26一个功能更强大,性能更高的树控件DevComponents.AdvTree.AdvTree(几种树形控件汇总)
    原文链接:https://www.cnblogs.com/a7373773/archive/2009/07/27/1532236.html一直在用DevComponents.DotNetBar2 控件近来探索Add()和AddRange()的性能问题。一样用极为不专业不科学的方法,比较DevComponents.AdvTree.AdvTree的Add()和AddRange()的性能 1private void butt
  • 2023-12-22C# selenium 超时设置
    //设置页面加载超时时间this.driver.Manage().Timeouts().PageLoad.Seconds.Equals(TimeSpan.FromSeconds(300));//隐式等待this.driver.Manage().Timeouts().ImplicitWait.Seconds.Equals(TimeSpan.FromSeconds(300));//异步脚本执行超时时间this.driver.Manage().Timeouts
  • 2023-11-29C#中TimeSpan和DateTime的用法详解
    在C#编程中,TimeSpan和DateTime是常用的日期和时间处理类。它们提供了丰富的方法和属性,方便我们对日期和时间进行操作和格式化。本篇博客将详细介绍TimeSpan和DateTime的用法。TimeSpanTimeSpan类用于表示一段时间间隔,可以表示从几天到几个纳秒的时间。下面是TimeSpan类的常用属
  • 2023-11-03C# 判断时间是否在指定时间段内,判断班别时间
    protectedboolgetTimeSpan(stringtimeStr){//判断当前时间是否在工作时间段内string_strWorkingDayAM="07:00";string_strWorkingDayPM="19:00";TimeSpandspWorkingDayAM=DateTime.Parse(_strWorkingDayAM).TimeOfDay;TimeSpands
  • 2023-10-29ASP.NET Core – DateTime, DateTimeOffset, DateOnly, TimeOnly, TimeSpan, TimeZone, NodaTime 基础
    前言心血来潮,这篇讲点基础的东西。对日期和时区TimeZone不熟悉的读者,请先看这篇 TimeZone,LeapYear,DateFormat,EpochTime时区,闰年,日期格式。 C#中的日期类型DateTime 
  • 2023-10-19C#判断当前时间是否在规定时间段范围内(二维数组超简版)
    直接上C#代码TimeSpannowTime=DateTime.Now.TimeOfDay;string[,]arr={{"7:50","8:10"},{"9:55","10:15"},{"13:55","14:10"},{"15:55","16:10"},{"18:55",
  • 2023-09-05dotnet 将任意时区的 DateTimeOffset 转换为中国时区时间文本
    本文告诉大家在拿到任意时区的DateTimeOffset对象,将DateTimeOffset转换为使用中国的+8时区表示的时间在开始之前,需要说明的是,采用DateTimeOffset会比DateTime更优的一个点是DateTimeOffset是带上时区的,这就意味着方便的在多个不同的时区进行传递和序列化的时候,不会丢
  • 2023-08-16naudio相关代码
    产生风鸣 静音 风鸣varbeep1=(newSignalGenerator(){Frequency=1000,Gain=0.2}).Take(TimeSpan.FromSeconds(2));varsilence=newSilenceProvider(beep1.WaveFormat).ToSampleProvider().Take(TimeSpan.FromSeconds(2));varbeep2=(newSignalGenerator(){
  • 2023-07-14TimeSpan 结构(struct);结构体的定义;与类的区别
    https://blog.csdn.net/zzu_seu/article/details/88366787https://vimsky.com/examples/detail/csharp-struct-system.timespan.htmlTimeSpan是结构类型(struct),即值类型,TimeSpan结构体属于System命名空间,在下文中一共展示了TimeSpan结构体的11个代码示例,这些例子默认根据受欢迎
  • 2023-06-29计划作业系列三:文件备份
    文件备份是一个很普遍的需求下载FreeFileSyncFreeFileSync另存为批处理,它会生成一个名为'BatchRun.ffs_batch'的xml文件。$trigger=New-JobTrigger-Once-At"8am"-RepetitionInterval(New-TimeSpan-Hour1)-RepetitionDuration([TimeSpan]::MaxValue)Register-Sche
  • 2023-05-28net core中BackgroundService
    publicclassPeriodicBackgroundTask:BackgroundService{privatereadonlyTimeSpan_period=TimeSpan.FromSeconds(5);privatereadonlyILogger<PeriodicBackgroundTask>_logger;publicPeriodicBackgroundTask(ILogger<PeriodicBackgroundT
  • 2023-05-18C#中的时间类
    DateTime类DateTime类是C#中最常用的时间类之一,它表示一个日期和时间。可以使用DateTime.Now属性获取当前时间,也可以使用DateTime.Parse方法将字符串转换为DateTime对象。//获取当前时间DateTimenow=DateTime.Now;//将字符串转换为DateTime对象DateTimedateTime=Date
  • 2023-01-29C#中检测代码执行时间
     使用System.Diagnostics.Stopwatch,usingSystem;usingSystem.Diagnostics;usingSystem.Threading;classProgram{staticvoidMain(string[]args){
  • 2022-11-29.NET6之MiniAPI(二十四):用Polly重试
    为了保障系统的稳定和安全,在调用三方服务时,可以增加重试和熔断。重试是调用一次失败后再试几试,避免下游服务一次闪断,就把整个链路终止;熔断是为了防止太多的次数的无效
  • 2022-11-23C#里面比较时间大小三种方法
    1、比较时间大小 stringst1="12:13"; stringst2="14:14"; DateTimedt1=Convert.ToDateTime(st1); DateTimedt2=Convert.ToDateTime(st2); DateTimedt3=DateT
  • 2022-11-22实例066 如何确定程序的运行时间
      usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usi
  • 2022-11-21WPF 后台线程操作界面元素不卡UI界面线程 Dispatcher
    经常要考虑的,后台的耗时操作不要卡死主界面的问题。<StackPanelVerticalAlignment="Center"><Labelx:Name="lblHello">欢迎你光临WPF的世界!</Label><ButtonName
  • 2022-11-12WPF 后台线程操作界面元素不卡UI界面线程 Dispatcher
    经常要考虑的,后台的耗时操作不要卡死主界面的问题。<StackPanelVerticalAlignment="Center"><Labelx:Name="lblHello">欢迎你光临WPF的世界!</Label><Button
  • 2022-10-28DateTimeHelper
    usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceZB.QueueSys.Common{publicclassDateTimeHelper{
  • 2022-10-14计算时间差
    C#计算时间差的四种方法项目开发过程中会需要获取与当前时间的时间差,整理了一下,一般下列四种就够了。1、相差秒publicdoubleDiffSeconds(DateTimestartTime,DateTi