Loading

随笔分类 -  C#

摘要:BenchmarkWatch.NET 介绍 BenchmarkWatch.NET 是为 DOTNET 平台快速定位代码运行耗时所设计, 优化代码执行效率, 快速分析代码质量的分析工具. 支持版本: net45 netstandard2.0 netstandard2.1 net6.0 net7.0 安 阅读全文
posted @ 2022-11-10 15:56 microestc 阅读(91) 评论(0) 推荐(0)
摘要:FFmpegs.NET This is a project that plans to build FFmpegs.NET dynamic libraries, it's call FFmpeg API on .NET Platform. 这是一个FFmpegs.NET的动态库,支持在 .NET 平 阅读全文
posted @ 2022-06-05 21:51 microestc 阅读(215) 评论(0) 推荐(0)
摘要:看图 代码 using System; namespace Cmd { class Program { public static void Main(params string[] args) { Loader.Read(); Loader.Native = null; GC.Collect(); 阅读全文
posted @ 2022-04-11 17:31 microestc 阅读(854) 评论(0) 推荐(0)
摘要:请注意 RuntimeInformation 支持 .netstandard2.0 以上的版本 using System; using System.Linq; using System.Runtime.InteropServices; Console.WriteLine(Environment.O 阅读全文
posted @ 2022-03-31 16:00 microestc 阅读(160) 评论(0) 推荐(1)
摘要:Append 追加不换行 AppendLine 追加并换行, 注意 → 先追加再换行. 阅读全文
posted @ 2022-02-08 19:04 microestc 阅读(1097) 评论(0) 推荐(0)
摘要:向 hexstring 转 var bytes = Encoding.ASCII.GetBytes("adjdkfk"); var hex = Convert.ToHexString(bytes); var bs = Convert.FromHexString(hex); 向 其它 base64 等 阅读全文
posted @ 2021-11-06 22:38 microestc 阅读(1585) 评论(0) 推荐(0)
摘要:直接上代码比较好 using System; using System.Collections.Generic; using System.Threading.Tasks; namespace src { public class Program { public static async Task 阅读全文
posted @ 2021-09-27 10:27 microestc 阅读(73) 评论(0) 推荐(0)
摘要:Unix time 表示自1970年1月1日01T00:00: 00Z (1970:00:00:00:00:,上午 12:00 AM UTC) 的秒数。 它不会考虑闰秒的时间。 此方法首先将当前实例转换为 UTC,然后再返回其 Unix 时间。 对于 1970-01-01T00:00:00Z 之前的 阅读全文
posted @ 2021-07-22 22:40 microestc 阅读(1039) 评论(0) 推荐(0)
摘要:[TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { // var isIp = IPAddress.TryParse("220.181.38.150", out var _); var addre 阅读全文
posted @ 2021-07-22 22:04 microestc 阅读(378) 评论(0) 推荐(0)
摘要:using System; using System.Threading; namespace Cmd { class Program { static void Main(string[] args) { var asynclocal = new AsyncLocal<int>(); var th 阅读全文
posted @ 2021-07-08 00:49 microestc 阅读(122) 评论(0) 推荐(0)
摘要:xx.csproj true 允许不安全代码和指针 <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net5.0</TargetFramework> <Al 阅读全文
posted @ 2021-07-07 00:43 microestc 阅读(92) 评论(0) 推荐(0)
摘要:很多时候需要调用其它语言生成的动态库,那么 c# 如何调用动态库呢 下面简单介绍 C# 调用 c 语言生成的动态库 func.c int add(int num1,int num2) { return num1 + num2; } 编译生成动态库文件 gcc -fPIC -shared func.c 阅读全文
posted @ 2021-06-30 16:46 microestc 阅读(2634) 评论(0) 推荐(0)
摘要:问题一 .csproj 项目包含静态文件,构建拷贝到输出文件目录 比如我想把项目根目录下 wwwroot 下的所有文件拷贝到输出目录 <ItemGroup> <None Remove="wwwroot\**" /> </ItemGroup> <ItemGroup> <Content Include= 阅读全文
posted @ 2021-05-13 23:59 microestc 阅读(617) 评论(0) 推荐(0)
摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 5 namespace Microestc.PaginatedList 6 { 7 public class PaginatedList<TResul 阅读全文
posted @ 2019-12-28 23:34 microestc 阅读(555) 评论(0) 推荐(0)
摘要:解密加密源码 1 using System; 2 using System.Security.Cryptography; 3 using System.Text; 4 5 namespace Wechat 6 { 7 public static class Security 8 { 9 public 阅读全文
posted @ 2019-11-10 00:30 microestc 阅读(8882) 评论(2) 推荐(5)
摘要:简单介绍,直接官方文档 https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-2.2 以下两个输出显示了两个请求的结果: 第一个请求: 控制器操作: 暂时性:d23 阅读全文
posted @ 2019-07-19 18:26 microestc 阅读(876) 评论(0) 推荐(0)