摘要: Task 从线程池中获得一个新线程 阅读全文
posted @ 2023-11-02 16:55 小包2017 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 自己记录 阅读全文
posted @ 2022-05-12 16:46 小包2017 阅读(40) 评论(0) 推荐(0) 编辑
摘要: C#官方源码参考 https://referencesource.microsoft.com/ C#官方源码参考 https://github.com/Unity-Technologies/UnityCsReference unity源码 阅读全文
posted @ 2020-05-11 10:42 小包2017 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 序列化和反序列化代码如下 /// <summary> /// 将一个object对象序列化,返回一个byte[] /// </summary> public static byte[] ObjectToBytes(object obj) { using (MemoryStream ms = new 阅读全文
posted @ 2020-04-23 14:50 小包2017 阅读(216) 评论(0) 推荐(0) 编辑
摘要: class Program { delegate void MyDelegate(string str); static void Main(string[] args) { //正常调用 MyDelegate myDelegate = new MyDelegate(CW); myDelegate( 阅读全文
posted @ 2020-01-17 09:38 小包2017 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 使用泛型可以定义接口,在接口中定义的方法可以带泛型参数。 《C#高级编程(第7版)》清华大学出版社 namespace Test { class Program { static void Main(string[] args) { TestClass testClass = new TestCla 阅读全文
posted @ 2020-01-13 11:06 小包2017 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 1. where T : struct 对于结构约束,类型T必须是值类型 2. where T : class 对于类约束,类型T必须是引用类型 3. where T : 接口名称IFoo 对于指定接口IFoo约束,类型T必须实现指定接口IFoo 4. where T : 类名Foo 对于指定类Fo 阅读全文
posted @ 2020-01-13 10:47 小包2017 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Linux 命令 ls 查看当前文件夹下所有文件 Linux 命令 Tab 自动补全命令 阅读全文
posted @ 2019-12-10 11:55 小包2017 阅读(103) 评论(0) 推荐(0) 编辑
摘要: C#对文件夹操作类 Directory C#判断字符串是否是以一定格式结尾 获取该文件夹下的所有文件和文件夹 获取当前unity的编译环境 EditorUserBuildSettings.activeBuildTarget 对应枚举 BuildTarget 阅读全文
posted @ 2019-09-20 10:12 小包2017 阅读(120) 评论(0) 推荐(0) 编辑
摘要: C#获取程序路径 string path1 = AppDomain.CurrentDomain.BaseDirectory; string path2 = Environment.CurrentDirectory; Console.WriteLine(path1); Console.WriteLin 阅读全文
posted @ 2019-05-16 15:53 小包2017 阅读(105) 评论(0) 推荐(0) 编辑