.net设计模式
1.单例模式
public sealed class Singleton
{
static intance=null;
static readonly object padlock=new object();
Singleton()
{}
public static Singleton Instance
{
get {
lock(padlock){
if(instance==null)
{instance= new Singleton(); }
return instance;
}
}
}
}
https://terrylee.cnblogs.com/archive/2005/12/09/293509.html