
C#
悠然少年心
做自己感兴趣的事
展开
-
C#线程、任务、异步处理
using System;using System.Threading;using System.Threading.Tasks;namespace ThreadTest{ class Program { static void Main(string[] args) { // Thread T1 = new Thread(new ThreadStart(func1));//委托 Thread T2 =原创 2022-01-20 15:19:11 · 270 阅读 · 0 评论 -
单例模式的简单入门
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace SingleDB{ class DBsingle { //从代码上来分析,单例模式,首先向外提供了一个可被访问的实例化的对象,如果没有此对象时, //该DBsingl类创建一个。如果遇到多线程并发访问,原创 2021-09-13 10:15:42 · 91 阅读 · 0 评论 -
一些基础易忘记的重要内容
class是引用类型,指向地址。struct是值类型,复制值不改变地址以上再泛型类中同样适用using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Threading;namespace std2{ class Program { static void Main(原创 2021-09-09 17:23:06 · 92 阅读 · 0 评论 -
c#中的委托
namespace Delegate{ delegate void AutoSkill();//1 这个AutoSkill是委托事件名 class Program { static void Main(string[] args) { Skill sk = new Skill(); AutoSkill apk = new AutoSkill(Skill5);//2 这里括号必须给方原创 2021-09-01 11:10:42 · 96 阅读 · 0 评论 -
c#中的线程创建
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;namespace threadTest{ class Program { static void Main(string[] args) { Thread t=new Thread(run);//1创建线程对象原创 2021-09-01 10:20:50 · 4522 阅读 · 0 评论