public void MsgHandler(IntPtr SID, EzvizMeesageType MsgType, uint Error, string Info, IntPtr iUser) { switch (MsgType) { case EzvizMeesageType.INS_PLAY_EXCEPTION: int intErrorCode = 0; string strErrorDesc = ""; //错误码 intErrorCode = SDK_EzvizSDK.OpenSDK_GetLastErrorCode(); IntPtr i = SDK_EzvizSDK.OpenSDK_GetLastErrorDesc(); strErrorDesc = Marshal.PtrToStringAnsi(i); MessageBox.Show(intErrorCode + "_" + strErrorDesc); break; case EzvizMeesageType.INS_PLAY_START: DateTime tim = DateTime.Now; TimeSpan tims = tim - timStartTime; MessageBox.Show(tims.ToString()); break; } MessageBox.Show(MsgType.ToString()); }