/// <summary>
/// 单例模式
/// </summary>
class singleton
{
//构造函数私有化,保证只能是自身创建对象
private singleton() { }
//单例(饿汉式,加载程序时直接创建实例)
private static singleton instance = new singleton();
//对外方法
public static singleton GetInstance()
{
return instance;
}
}