private void btn_Exit_Click(object sender, EventArgs e) { //停止预览 if (_mLRealHandle >= 0) { ChcNetSdk.NET_DVR_StopRealPlay(_mLRealHandle); _mLRealHandle = -1; } //注销登录 if (_mLUserId >= 0) { ChcNetSdk.NET_DVR_Logout(_mLUserId); _mLUserId = -1; } ChcNetSdk.NET_DVR_Cleanup(); Application.Exit(); }
/// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (_mLRealHandle >= 0) { ChcNetSdk.NET_DVR_StopRealPlay(_mLRealHandle); } if (_mLUserId >= 0) { ChcNetSdk.NET_DVR_Logout(_mLUserId); } if (_mBInitSdk == true) { ChcNetSdk.NET_DVR_Cleanup(); } if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); }