---
title: "C#  单例模式"
author: "冷寒冰"
date: "2013-11-06T16:43:33Z"
tags: []
slug: "c"
draft: false
lastmod: "2013-11-06T16:43:33Z"
id: 1972161
url: "https://pmandy-163-com.iteye.com/blog/1972161"
---

public class MySigleton
{
    private static MySigleton instance;
 
    private MySigleton() { }
 
    public static MySigleton InstanceMySigleton
    {
        get
        {
            if (instance == null)
            {
                instance = new MySigleton();
            }
            return instance;
        }
     }
}