这通常表示其他存储器已损坏

这通常表示其他存储器已损坏

本文介绍了我有一个错误“尝试读取或写入受保护的内存".这通常表示其他存储器已损坏.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用zkemkeeper类连接指纹.

我有一种从指纹同步用户的方法,如下所示:

I use zkemkeeper class to connect with fingerprint.

I have a method for synchronize user from fingerprint as follow:

private void SynchronizeUser_Clicked(object sender, EventArgs e) {
            if (currentMouseOverRow >= 0) {
                string Status = Convert.ToString(GVDevices.GetRowCellValue(currentMouseOverRow, "Status"));
                if (Status == "Connect") {
                    axCZKEM1.ReadAllUserID(iMachineNumber);

                    string sdwEnrollNumber = "";
                    string sName = "";
                    string sPassword = "";
                    int iPrivilege = 0;
                    bool bEnabled = false;

                    Dt = new DataTable();
                    StrSQL = "select * from MsEmployee";
                    cldb.sqlSelectReturnDt(StrSQL, Dt);

                    if (Dt.Rows.Count == 0) {
                        StrSQL = "";

                        while (axCZKEM1.SSR_GetAllUserInfo(iMachineNumber, out sdwEnrollNumber, out sName, out sPassword, out iPrivilege, out bEnabled)) {
                            StrSQL += "insert into MsEmployee(EmployeeID, EmployeeName) " + System.Environment.NewLine +
                                      "values(" + sdwEnrollNumber + ", '" + sName + "') " + System.Environment.NewLine;
                        }

                        if (cldb.SqlExecuteQuery(StrSQL) == 1) {
                            clglobal.ShowMessage("Success synchronize user.");
                        } else {
                            clglobal.ShowMessage("Fail synchronize user!");
                        }
                    } else {
                        String StrSQLUser = "";

                        while (axCZKEM1.SSR_GetAllUserInfo(iMachineNumber, out sdwEnrollNumber, out sName, out sPassword, out iPrivilege, out bEnabled)) {
                            StrSQL = "select * from MsEmployee where EmployeeID = " + sdwEnrollNumber + "";
                            cldb.sqlSelectReturnDt(StrSQL, Dt);

                            if (Dt.Rows.Count > 0) {
                                if (Convert.ToString(Dt.Rows[0]["EmployeeName"]) != sName) {
                                    StrSQLUser += "update MsEmployee set EmployeeName='" + sName + "'" + System.Environment.NewLine +
                                                  "where EmployeeID=" + sdwEnrollNumber + "";
                                }
                            } else {
                                StrSQLUser += "insert into MsEmployee(EmployeeID, EmployeeName) " + System.Environment.NewLine +
                                              "values(" + sdwEnrollNumber + ", '" + sName + "') " + System.Environment.NewLine;
                            }
                        }

                        if (cldb.SqlExecuteQuery(StrSQLUser) == 1) {
                            clglobal.ShowMessage("Success synchronize user.");
                        } else {
                            clglobal.ShowMessage("Fail synchronize user!");
                        }
                    }
                } else {
                    clglobal.ShowMessage("Please connect the device first!");
                    return;
                }
            }
        }



但我有这样的错误:
我遇到错误尝试读取或写入受保护的内存.这通常表明其他内存已损坏."

我也一直在浏览,发现有一篇文章要取消选中
抑制模块负载上的JIT优化(仅受管理)"
但是我无法调试我的源代码.


请帮助我,为什么会发生这种情况?

谢谢



But i have an error like this:
I have a error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

I''ve also been browsing and found an article to uncheck
"Surpress JIT optimization on module load(Managed only)"
but i can''t debug my sourcecode.


Please help me, why this could happen?

Thanks

推荐答案


这篇关于我有一个错误“尝试读取或写入受保护的内存".这通常表示其他存储器已损坏.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 21:31