C#
Csoap994
这个作者很懒,什么都没留下…
展开
-
C#之语法笔记
拓展方法原创 2019-12-30 17:21:05 · 185 阅读 · 0 评论 -
C#之常用笔记
栈的迭代 private Stack<string> _StaArray = new Stack<string>(); void Start () { Test2(); } private void Test2() { _StaArray...原创 2019-09-24 22:56:35 · 140 阅读 · 0 评论 -
C#之Json操作JsonMapper解析
json技能信息[{"id":2,"name":"天下无双","damage":123 },{"id":3,"name":"天下无贼","damage":21 },{"id":4,"name":"咫尺天涯","damage":900 }]json主角信息{ "Name":"siki", "Level":99, "Age":18, "SkillList":[ {"id":...原创 2019-08-10 14:53:24 · 6011 阅读 · 0 评论 -
C#之XML操作
DEMO1XML文档<skills> <skill> <id>2</id> <name lang="cn">天下无双</name> <damage>123</damage> </skill> <skill> <id>3...原创 2019-08-10 14:16:31 · 297 阅读 · 0 评论 -
c#之线程争用条件
MyThreadObject.csusing System;namespace leanThrean{ public class MyThreadObject { private int state = 5; public void ChangeState() { state++; if(sta...原创 2019-08-06 21:21:47 · 395 阅读 · 0 评论 -
C#之tcpListener、tcpClient、udpClient
tcp服务端 tcpListenerusing System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Sockets;using System.Runtime.InteropServices;using System.Text;using System...原创 2019-08-08 00:01:30 · 278 阅读 · 0 评论 -
C#之Socket的TCP方式广播聊天室
服务端代码:Program.csusing System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Sockets;using System.Net.WebSockets;using System.Text;using System.Threading....原创 2019-08-07 23:15:47 · 1169 阅读 · 0 评论 -
C#之socket的UDP连接
服务端启动文件using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Sockets;using System.Text;using System.Threading;using System.Threading.Tasks;namespa...原创 2019-08-07 23:09:01 · 415 阅读 · 0 评论 -
C#之语言集成查询(LINQ)
常用案例如下using System;using System.Collections.Generic;using System.Linq;using System.Security.Cryptography;using System.Text;using System.Threading.Tasks;namespace _013_LINQ{ internal class...原创 2019-07-30 16:36:33 · 169 阅读 · 0 评论 -
C#之基于观察者模式讲解事件
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace _012_观察者设计模式_猫捉老鼠 { class Program { static void Main(string[...原创 2019-07-30 11:31:21 · 144 阅读 · 0 评论 -
C#之多播委托的单独调用、异常处理
包含多个方法的委托成为多播委托,调用多播委托,可以按照顺序连续调用多个方法,因此,委托的签名就必须返回void;否则,就只能得到委托调用的最好一个方法的结果多播委托可以用运算符"+“和”+=“给委托添加方法调用,同样也可以用运算符”-“和”-="给委托删除方法调用void Hello(string s) { System.Console.WriteLine(" ...转载 2019-07-29 18:19:45 · 462 阅读 · 0 评论 -
C#之冒泡排序通用篇
主文件using System;using System.Text;namespace _01{ class Program { static void Main(string[] args) { TestSort();//int冒泡排序 TestComonSort();//任意类型冒泡排序 ...原创 2019-07-29 17:53:25 · 174 阅读 · 0 评论 -
C#之String与StringBuilder
目录1.什么时候用String?什么时候用StringBuilder?2.String与StringBuilder的区别总结1.什么时候用String?什么时候用StringBuilder?字符串一旦创建就不可修改大小,每次使用System.String类中的方法之一时,都要在内存中创建一个新的字符串对象,这就需要为该新对象分配新的空间。在需要对字符串执行重复修改的情况下,与创建新的Strin...原创 2019-07-15 15:47:47 · 161 阅读 · 0 评论 -
C#之使用泛型和索引器实现集合类功能
using System;namespace _02{ public class MyList<T>where T:IComparable //表示继承自可比较接口 { private T[] array; private int count=0;//表示当前添加的元素的个数 public MyList(int s...原创 2019-07-08 02:17:59 · 593 阅读 · 0 评论 -
Unity3D之常用API方法
物体三种方法 GameObject go = new GameObject("cube"); //创建空物体 GameObject.Instantiate(prefab); //根据预制体创建 GameObject.CreatePrimitive(PrimitiveType.Cube); // 根据类型创建对象根据对象新增组件 GameObject go = GameO...原创 2019-06-17 19:54:18 · 485 阅读 · 0 评论 -
C#之数据类型
BOOL型为int型,一般认为占4个字节,取值TRUE/FALSE/ERROR。sbyte型为有符号8位整数,占1个字节,取值范围在-128 ~ 127之间。bytet型为无符号16位整数,占2个字节,取值范围在0~255之间。short型为有符号16位整数,占2个字节,取值范围在-32,768~32,767之间。ushort型为无符号16位整数,占2个字节,取值范围在0~65,535之...原创 2019-06-04 10:36:30 · 199 阅读 · 0 评论 -
C#之访问权限
C#里类及类成员的修饰符有以下五个如下:public 公开 类及类成员的修饰符 对访问成员没有级别限制private 私有 类成员的修饰符 只能在类的内部访问protected 受保护的 类成员的修饰符 只能在该类和该类的派生类中访问,不管该派生类和基类是否在同一程序集中internal 内部的 类及类成员的修饰符 访问仅限于程序集中protected internal 受保护的内部 什...转载 2019-06-06 15:54:35 · 1144 阅读 · 0 评论