随笔分类 -  C#

一些基于C#语言的技术实例
摘要:1、开启SMTP服务,相当于授权过程(开启后,才可以通过这个模拟发送) 位置: 设置--> 账号--> 账号安全--> POP3/SMTP服务 -->开启 2、编写发送邮箱邮件API(引用:System.Net,System.Net.Mail) [Route("api/[controller]")] 阅读全文
posted @ 2024-12-21 22:10 microsoft-zhcn 阅读(76) 评论(0) 推荐(0) 编辑
摘要:分布式缓存框架: Microsoft Velocity:微软自家分布式缓存服务框架。 Memcahed:一套分布式的高速缓存系统,目前被许多网站使用以提升网站的访问速度。 Redis:是一个高性能的KV数据库。 它的出现很大程度补偿了Memcached在某些方面的不足。 EnyimMemcached 阅读全文
posted @ 2024-07-23 17:00 microsoft-zhcn 阅读(44) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.cnblogs.com/yellow3gold/p/17375015.html 阅读全文
posted @ 2024-07-23 16:46 microsoft-zhcn 阅读(16) 评论(0) 推荐(0) 编辑
摘要:目录 简介 使用方法 实现客户端 实现服务端 总结 简介# 工作中经常遇到需要实现TCP客户端或服务端的时候,如果每次都自己写会很麻烦且无聊,使用SuperSocket库又太大了。这时候就可以使用SimpleTCP了,当然仅限于C#语言。 SimpleTCP是一个简单且非常有用的 .NET 库,用于 阅读全文
posted @ 2024-07-23 15:20 microsoft-zhcn 阅读(331) 评论(0) 推荐(0) 编辑
摘要:IOC框架 Unity:微软patterns&practicest团队开发的IOC依赖注入框架,支持AOP横切关注点。 MEF(Managed Extensibility Framework):是一个用来扩展.NET应用程序的框架,可开发插件系统。 Spring.NET:依赖注入、面向方面编程(AO 阅读全文
posted @ 2024-07-23 14:57 microsoft-zhcn 阅读(159) 评论(0) 推荐(0) 编辑
摘要:1. 无损快速分割视频 1.1:从 01:45 秒开始截取,一直到结束。 备注:这个执行过程非常快。 cd C:\MyFiles\FFmpeg\ffmpeg-v2022-03-09\ffmpeg\bin ffmpeg -i "D:\周星驰《功夫》.mp4" -ss 00:01:45 -codec c 阅读全文
posted @ 2024-07-23 10:07 microsoft-zhcn 阅读(15) 评论(0) 推荐(0) 编辑
摘要:https://flurl.dev/docs/testable-http/ 注意:除了 URL 构建和解析之外的所有内容都需要安装Flurl.Http而不是基本的Flurl包。 考虑与 HTTP 服务交互的一种非常常见的方式是“我想构建一个 URL,然后调用它”。Flurl.Http 允许您非常简洁 阅读全文
posted @ 2024-07-11 13:39 microsoft-zhcn 阅读(361) 评论(0) 推荐(0) 编辑
摘要:通过NuGet来安装SuperSocket客户端,SuperSocket.ClientEngine 实现代码如下: public partial class MainPage : Page { SuperSocket.ClientEngine.AsyncTcpSession client = nul 阅读全文
posted @ 2024-07-11 11:29 microsoft-zhcn 阅读(135) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.cnblogs.com/lizhigang/p/15523216.html 参考:https://www.cnblogs.com/lizhigang/p/15523207.html 阅读全文
posted @ 2024-07-11 10:10 microsoft-zhcn 阅读(17) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.cnblogs.com/ryanzheng/p/8066241.html 阅读全文
posted @ 2024-06-18 13:51 microsoft-zhcn 阅读(9) 评论(0) 推荐(0) 编辑
摘要:C# 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.IO; namespace ConsoleApp 阅读全文
posted @ 2024-06-12 17:40 microsoft-zhcn 阅读(311) 评论(0) 推荐(0) 编辑
摘要:第一步:创建Windos服务 第二步:添加安装程序,此时页面出现serviceProcessInstaller1、serviceInstaller1 第三步:设置服务信息,StartType 选择 Automatic 第四步:设置登录身份信息,Account 选择 LocalSystem 第五步:写 阅读全文
posted @ 2024-05-25 17:16 microsoft-zhcn 阅读(231) 评论(0) 推荐(0) 编辑
摘要:ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.UseShellExecute = false; startInfo.WorkingDirectory = Environment.Cu 阅读全文
posted @ 2024-05-23 01:21 microsoft-zhcn 阅读(56) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.cnblogs.com/wzwyc/p/6295954.html 阅读全文
posted @ 2024-05-23 01:20 microsoft-zhcn 阅读(9) 评论(0) 推荐(0) 编辑
摘要:工具类: https://www.cnblogs.com/yaozhiguang/p/7214553.html https://github.com/ldqk/Masuit.Tools Newtonsoft.Json、System.Text.Json:序列化 Dapper:关系映射 Autofac: 阅读全文
posted @ 2024-01-08 09:12 microsoft-zhcn 阅读(241) 评论(0) 推荐(0) 编辑
摘要:生成单独的exe文件 C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe Program.cs生成 exe 文件的步骤如下: 1. 使用文本编辑器(如 Notepad++ 或 Visual Studio Code)编写 C# 源代码,并将其保存 阅读全文
posted @ 2023-06-06 08:38 microsoft-zhcn 阅读(1021) 评论(0) 推荐(0) 编辑
摘要:编译 Class1.cs 以产生 Class1.dll: csc /target:library Class1.cs这个就是我们使用最多的一个命令,其实可以简单的写成csc /t:library Class1.cs,另外的一个写法是csc /out:Class1.dll /t:library Cla 阅读全文
posted @ 2023-04-17 08:50 microsoft-zhcn 阅读(163) 评论(0) 推荐(0) 编辑
摘要:参考:https://www.it1352.com/2599186.html 1. 声明Claim数组 Claim[] myClaims = new Claim[] { new Claim("UserNo", "1"), //自定义 new Claim(ClaimTypes.Role,"User") 阅读全文
posted @ 2022-12-15 15:50 microsoft-zhcn 阅读(35) 评论(0) 推荐(0) 编辑
摘要:C# 集合 using System.Data; using System.Collections; //数组(Array) string[] arr = { "Hello", "World" }; int[] nums = { 1, 99, 2, 66, 15, 8 }; //哈希表(Hashta 阅读全文
posted @ 2022-11-26 18:50 microsoft-zhcn 阅读(81) 评论(0) 推荐(0) 编辑
摘要:[System.Runtime.InteropServices.DllImport("wininet")] private extern static bool InternetGetConnectedState(out int connectionDescription, int reserved 阅读全文
posted @ 2022-11-12 17:51 microsoft-zhcn 阅读(118) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示