摘要: 1. 泛型方法:一个方法满足不同类型,做同样的事 泛型与object的区别: 当类性为object的时候: /// <summary> /// 打印个object值 /// 1 object类型是一切类型的父类 /// 2 通过继承,子类拥有父类的一切属性和行为;任何父类出现的地方,都可以用子类来代 阅读全文
posted @ 2021-01-07 23:04 wxmax 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 本章将开启mybatis系列 mybatis介绍 mybatis 是一个优秀的基于 java 的持久层框架,它内部封装了 jdbc,使开发者只需要关注 sql 语句本身, 而不需要花费精力去处理加载驱动、创建连接、创建 statement 等繁杂的过程。 mybatis 通过 xml 或注解的方式将 阅读全文
posted @ 2020-12-14 22:51 wxmax 阅读(306) 评论(0) 推荐(0) 编辑
摘要: //封装一个sqlHelper public static class SqlHelper { //定义一个连接字符串,readOnly修饰变量,只能在初始化的时候复制,以及在构造函数中赋值 private static readonly string conStr = ConfigurationM 阅读全文
posted @ 2020-10-05 23:02 wxmax 阅读(364) 评论(0) 推荐(0) 编辑
摘要: File类提供用于创建、复制、删除、移动和打开单一文件的静态方法,并协助创建 FileStream 对象。 FileInfo:文件操作(创建,读写性) DirctoryInfo:文件夹操作 File:文件读写 使用流读取文件适合用于读写比较大的文件 FileStream:适合读取二进制文件 Stre 阅读全文
posted @ 2020-09-09 22:54 wxmax 阅读(1995) 评论(0) 推荐(0) 编辑
摘要: 1.首先创建server端 class Program { static void Main(string[] args) { Console.WriteLine("Server is Running..."); //1.TcpListener对socket进行了一次封装,这个类会自己创建socke 阅读全文
posted @ 2020-09-08 23:34 wxmax 阅读(732) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { //string connStr = "server=.;database=TestBase;uid=lyc;pwd=123456;Max Pool Size=5;"; //for (int i = 阅读全文
posted @ 2020-09-07 22:33 wxmax 阅读(152) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { SqlConnection conn = new SqlConnection(); //1.手写 //string connStr = "server=.;database=db1;uid=sa;pw 阅读全文
posted @ 2020-09-07 22:12 wxmax 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 1 猫类Cat class Cat{ public string name; public string color; public Cat(string name, string color){ this.name = name; this.color = color; } public void 阅读全文
posted @ 2020-09-07 10:25 wxmax 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1.cat类 class Program { static int Test1() { return 1; } static int Test2(string s) { //Console.WriteLine(s); return 100; } static void Main(string[] a 阅读全文
posted @ 2020-09-07 08:33 wxmax 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 1 class Program { private delegate string GetAStr(); static void Main(string[] args) { //int x = 40; //string s = x.ToString(); //Console.WriteLine(s) 阅读全文
posted @ 2020-09-07 08:31 wxmax 阅读(163) 评论(0) 推荐(0) 编辑