我这里有 NAC-5000 设备,并且已经连接到我的本地服务器。我通过 AccessManager 测试了功能及其正常和工作。我使用指纹和卡(Mifare)进行身份验证。
我的问题是我想使用 SDK 示例 C# 使用卡或指纹在设备上进行身份验证,但代码不起作用NBioAPI_OpenDevice 错误:0102
设备已连接到我的本地 LAN
private void btnRegist_Click(object sender, System.EventArgs e)
{
NBioAPI.Type.HFIR hNewFIR;
uint nUserID = 0;
// Get User ID
try
{
int test = Convert.ToInt32(textUserID.Text, 10);
if (test == 0)
throw(new Exception());
}
catch
{
MessageBox.Show("User ID must be have numeric type and greater than 0.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
nUserID = Convert.ToUInt32(textUserID.Text, 10);
// Get FIR data
m_NBioAPI.OpenDevice(NBioAPI.Type.DEVICE_ID.AUTO);
uint ret = m_NBioAPI.Enroll(out hNewFIR, null);
if (ret != NBioAPI.Error.NONE)
{
DisplayErrorMsg(ret);
m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
return;
}
m_NBioAPI.CloseDevice(NBioAPI.Type.DEVICE_ID.AUTO);
// Regist FIR to IndexSearch DB
NBioAPI.IndexSearch.FP_INFO[] fpInfo;
ret = m_IndexSearch.AddFIR(hNewFIR, nUserID, out fpInfo);
if (ret != NBioAPI.Error.NONE)
{
DisplayErrorMsg(ret);
return;
}
// Add item to list of SearchDB
foreach (NBioAPI.IndexSearch.FP_INFO sampleInfo in fpInfo)
{
ListViewItem listItem = new ListViewItem();
listItem.Text = sampleInfo.ID.ToString();
listItem.SubItems.Add(sampleInfo.FingerID.ToString());
listItem.SubItems.Add(sampleInfo.SampleNumber.ToString());
listSearchDB.Items.Add(listItem);
}
textUserID.Text = Convert.ToString(Convert.ToInt32(textUserID.Text) + 1);
}
我在 64 位操作系统 Win 7 上运行它