摘要:
一、创建控制台项目 二、安装Tesseract 三、安装语言包 路径:bin\Debug\net5.0\tessdata 四、执行Demo static void Main(string[] args) { string txtResult = string.Empty; using (var en 阅读全文
摘要:
.NET var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllers(); // Learn more about config 阅读全文
摘要:
构造注入时接收空对象导致执行错误的处理方式: 基本情况: interface ILog { void Info(string msg); void Wran(string msg); } class BankAccount { private readonly ILog log; private i 阅读全文
摘要:
Server: using System.Text; Console.WriteLine("UDP Server Satrt..."); Socket udpServer = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, Proto 阅读全文
摘要:
suggested use Asynchronous Programming(Async Task) Server: int connectCount = 0; Console.WriteLine("wait for conncet..."); Socket tcpServer = new Sock 阅读全文
摘要:
基础配置(连接、访问等) public class MongoDBHelper<T> where T : class { private static MongoClient _mongoClient; private static IMongoDatabase _mongodb; private 阅读全文
摘要:
解释器模式(Interpreter Pattern) 提供了评估语言的语法或表达式的方式,它属于行为型模式。这种模式实现了一个表达式接口,该接口解释一个特定的上下文。这种模式被用在 SQL 解析、符号处理引擎等。 .情景:将 string input = "(12+5)-(12+1)";进行解析,并 阅读全文
摘要:
两个银行之间进行汇款: public class BankAccount { private int balance; private int overdraft = -500; /// <summary> /// 存款 /// </summary> /// <param name="amount" 阅读全文
摘要:
public class BankAccount { private int balance; private int overdraft = -500; /// <summary> /// 存款 /// </summary> /// <param name="amount"></param> pu 阅读全文
摘要:
命令模式(Command Pattern)是一种数据驱动的设计模式,它属于行为型模式。请求以命令的形式包裹在对象中,并传给调用对象。调用对象寻找可以处理该命令的合适的对象,并把该命令传给相应的对象,该对象执行命令。 银行取款存款例子: 把各中操作扁平化,然后自定义编辑指令进行组合。最后按顺序执行! 阅读全文