编程开发 软件列表

C#自动获取文件编码txt自动判断文件编码
C#.net

C#自动获取文件编码txt自动判断文件编码

2022-04-28 标签:C#自动获取文件编码,自动判断文件编码,C#判断文件编码

今天在用c#读取txt文件,乱码了,用默认的编码不行,得用指定的编码才可以.因为每个文件的编码可能都不一样,有没有一种一劳永逸的方法,那肯定是有~自动判断文件的编码.下面就直接上代码了.public static Encoding GetEncoding(string filename){try{r

Quartz.NET 3.4开源作业调度系统发布了
C#.net

Quartz.NET 3.4开源作业调度系统发布了

2022-03-27 标签:Quartz.NET3.4,开源作业调度系统,OpenTelemetry,Instrumentation,Microsoft,触发器,NET开源作业调度系统

Quartz.NET 3.4是一个功能齐全的开源作业调度系统,可用于从最小的应用程序到大型企业系统。此版本仅在应用程序启动成功完成后才开始执行 Quartz 作业,除非使用 QuartzHostedServiceOptions 另有指定。默认情况下,这会阻止作业在应用程序仍在启动时运行,并且它减少了

C#使用lambda合并列表中列表
C#.net

C#使用lambda合并列表中列表

2022-03-27 标签:C#使用lambda合并列表,C#使用linq合并列表,C#合并列表中的列表

今天的做C#项目时,突然要对list列表的列表进行合并汇总,哈哈,写linq和lambda不多,试过几个方法都不行.具体代码如下就是对List list中的列表ReportItems进行合并!一般情况下,如果是两个list列表,直接是union即可,但是现在List中的列表呢.当然用最简单的方法就遍

VS中NET6.0 Program.cs没有显示命名空间(VS顶级模板)
C#.net

VS中NET6.0 Program.cs没有显示命名空间(VS顶级模板)

2022-02-23 标签:VS,NET6.0,Program,cs,没有,显示,命名,空间,顶级,模板,新建,VS2022,Hello,World,Main,https,docs,microsoft

开始用新的VS2022后,新建个NET6.0的项目,发现没有命名空间和引用名称.如图:只有一句简单的Hello World输出.这是怎么回事?原来从NET6.0开始,使用了与以前不的新模板.新模板将Program.cs视为顶级文件,里面的代码为顶级语句(原来的Main方法).所以要是不习惯,可以将新

升级NET6.0后报错InvalidOperationException: The view 'Index' was not found
Asp.net

升级NET6.0后报错InvalidOperationException: The view 'Index' was not found

2022-02-14 标签:InvalidOperationException,升级NET6.0,The view Index found,视图,asp.net,core2.1,Microsoft,AspNetCore,Razor,Design

今天将asp.net core2.1升级到NET6.0后报错:InvalidOperationException: The view 'Index' was not found.如图:大概意思就是Index视图没有找到导致出错,仔细看了,视图是有的.网上找了很多方法都没有用.最后折腾半天,发现之前升

NET6报错A relational store has been configured without specifying either the DbConnection or connection string to use
Asp.net

NET6报错A relational store has been configured without specifying either the DbConnection or connection string to use

2022-01-28 标签:NET6,报错,A,relational,store,configured,without,specifying,either,DbConnection,connection,string,use,MysqlContext,options,ConnectionString,版本,asp.net,core6.0

今天在将项目升级到asp.net core6.0后发现报错A relational store has been configured without specifying either the DbConnection or connection string to use.项目使用的数据库是My

ubuntu asp.net core读取appSettings.json问题
Asp.net

ubuntu asp.net core读取appSettings.json问题

2022-01-28 标签:ubuntu,asp.net core,appsettings.json,问题,dotnet,appSettings,Value cannot be null,Hangfire.MySql.MySqlStorage,ubuntu appSettings

今天在ubuntu发直接运行命令dotnet /var/www/down/Down.Web.dll发现报错Value cannot be null. (Parameter 'connectionString') at Hangfire.MySql.MySqlStorage等.起初还以为是配置有问题,

C#net core报Keys will not be persisted to storage
Asp.net

C#net core报Keys will not be persisted to storage

2022-01-22 标签:C#,net,core,Keys,persisted,storage,存储,Using,repository,HKLM,应用程序,密钥,注册表,用户,修改,配置文件,memory,Neither

今天在查看网站日志的,看到警报:Using an in-memory repository. Keys will not be persisted to storage.Neither user profile nor HKLM registry available. Using an epheme

VS发布asp.net core项目在web.config包含production环境变量
Asp.net

VS发布asp.net core项目在web.config包含production环境变量

2022-01-22 标签:VS,发布,asp.net,core,项目,web,config,包含,production,环境变量,EnvironmentName,PropertyGroup,设置,配置文件,文件,Visual,Studio,2022,NET6.0

今天在用Visual Studio 2022发布NET6.0或者说asp.net core发布时,在web.config包含production或者Development,VS在发布时替换asp.net core中的web.config