#region 实现IDisposable public void Dispose() { Dispose(true); GC.SuppressFinalize(this);//防止Finalize调用 } protected virtual void Dispose(bool disposing) { if (!m_disposed) { if (disposing) { //释放托管资源 mutex.Close(); } //释放非托管资源 m_disposed = true; } } ~App() { Dispose(false); } #endregion