2024年2月25日

摘要: Linux概念 Linux是一个开发源码的高性能的操作系统。 Linux安装 选择在windows系统上安装Linux系统 条件:Ⅰ、CentOS-7-x86_64-DVD-1708.iso Ⅱ、VMware Workstation Ⅲ、Xshell(Linux远程工具) 步骤:Ⅰ、先安装VMwar 阅读全文
posted @ 2024-02-25 15:36 召唤师857 阅读(5) 评论(0) 推荐(0) 编辑

2022年10月20日

摘要: 一、接口的作用: 我们定义一个接口: public interface IBark { void Bark(); } 1、 再定义一个类,继承于IBark,并且必需实现其中的Bark()方法 public class Dog:IBark { public Dog() {} public void B 阅读全文
posted @ 2022-10-20 10:24 召唤师857 阅读(72) 评论(0) 推荐(0) 编辑

2022年9月29日

摘要: 安装 FluentValidation 新建了一个很简单的.NET Core 的Web API 程序,只有一个接口是用户注册,入参是一个User类, 然后在Nuget中安装 FluentValidation。 创建第一个验证 对于要验证的每个类,必须创建其自己的验证器,每个验证器类都必须继承 Abs 阅读全文
posted @ 2022-09-29 14:03 召唤师857 阅读(112) 评论(0) 推荐(0) 编辑

2021年8月25日

摘要: params参数定义:将实参列表中跟可变参数数组类型一致的元素都当做数组的元素去处理 int[] Maps=new int[10]; //方法体 public static void forIntArray(int io,params int[] array) { for (int i = 0; i 阅读全文
posted @ 2021-08-25 15:32 召唤师857 阅读(641) 评论(0) 推荐(0) 编辑
 
摘要: 定义:out参数就侧重于在一个方法中可以返回多个不同类型的值 //方法体 public int Get(int i,out int x,out string name) { x=0; name=""; return i;//返回前给out参数赋值 } //调用方法 int x;//接收返回值x st 阅读全文
posted @ 2021-08-25 15:15 召唤师857 阅读(697) 评论(0) 推荐(0) 编辑
 
摘要: ref 参数定义:能够将变量带入一个方法中进行改变,改变完成后,再将改变后的值带出方法并赋值给原变量 int num1=10; int num2=20; //方法主体(变量值互换) public void Get(ref int n1,ref int n2) { int temp = n1; n1= 阅读全文
posted @ 2021-08-25 14:51 召唤师857 阅读(264) 评论(0) 推荐(0) 编辑

2021年8月13日

摘要: /// <summary> /// <summary> /// 字符串转Unicode /// </summary> /// <param name="source">源字符串</param> /// <returns>Unicode编码后的字符串</returns> public static s 阅读全文
posted @ 2021-08-13 13:39 召唤师857 阅读(345) 评论(0) 推荐(0) 编辑

2021年7月27日

摘要: 1.WebSocket 服务端 static void Main(string[] args) { IPEndPoint localEP = new IPEndPoint(IPAddress.Any, 1818); FleckLog.Level = LogLevel.Debug; var allSo 阅读全文
posted @ 2021-07-27 17:07 召唤师857 阅读(976) 评论(0) 推荐(0) 编辑
 
摘要: 发送和接收邮箱要选择有smtp服务的邮箱,如:qq.com和163.com等 1.首先发送邮箱要开通smtp服务(找不到开启位置的可以百度一下,这里不做赘述) 2.如何生成授权码 3.Demo源码 public string smtpService = "smtp.qq.com";//发送邮箱的sm 阅读全文
posted @ 2021-07-27 17:04 召唤师857 阅读(95) 评论(0) 推荐(0) 编辑
 
摘要: 直接贴代码(源码中部分CSS和JS文件请到官网中下载引用) @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</ti 阅读全文
posted @ 2021-07-27 16:46 召唤师857 阅读(212) 评论(0) 推荐(0) 编辑