下面李纳只是个简单的例子,作参考
//首先,声明通用接口
[DllImport("sdtapi.dll")]
public static extern int SDT_OpenPort(int iPortID)
[DllImport("sdtapi.dll")]
public static extern int SDT_ClosePort(int iPortID)
[DllImport("sdtapi.dll")]
public static extern int SDT_PowerManagerBegin(int iPortID, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_AddSAMUser(int iPortID, string pcUserName, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_SAMLogin(int iPortID, string pcUserName, string pcPasswd, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_SAMLogout(int iPortID, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_UserManagerOK(int iPortID, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ChangeOwnPwd(int iPortID, string pcOldPasswd, string pcNewPasswd, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ChangeOtherPwd(int iPortID, string pcUserName, string pcNewPasswd, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_DeleteSAMUser(int iPortID, string pcUserName, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_StartFindIDCard(int iPortID, ref int pucIIN, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_SelectIDCard(int iPortID, ref int pucSN, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ReadBaseMsg(int iPortID, string pucCHMsg, ref int puiCHMsgLen, string pucPHMsg, ref int puiPHMsgLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ReadBaseMsgToFile(int iPortID, string fileName1, ref int puiCHMsgLen, string fileName2, ref int puiPHMsgLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_WriteAppMsg(int iPortID, ref byte pucSendData, int uiSendLen, ref byte pucRecvData, ref int puiRecvLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_WriteAppMsgOK(int iPortID, ref byte pucData, int uiLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_CancelWriteAppMsg(int iPortID, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ReadNewAppMsg(int iPortID, ref byte pucAppMsg, ref int puiAppMsgLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ReadAllAppMsg(int iPortID, ref byte pucAppMsg, ref int puiAppMsgLen, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_UsableAppMsg(int iPortID, ref byte ucByte, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_GetUnlockMsg(int iPortID, ref byte strMsg, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_GetSAMID(int iPortID, ref byte StrSAMID, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_SetMaxRFByte(int iPortID, byte ucByte, int iIfOpen)
[DllImport("sdtapi.dll")]
public static extern int SDT_ResetSAM(int iPortID, int iIfOpen)
[DllImport("WltRS.dll")]
public static extern int GetBmp(string file_name, int intf)
public delegate void De_ReadICCardComplete(clsEDZ objEDZ)
public event De_ReadICCardComplete ReadICCardComplete
private clsEDZ objEDZ = new clsEDZ()
private int EdziIfOpen = 1 //自动开关串口
int EdziPortID
public clsICCard()
{
}
public bool ReadICCard()
{
bool bUsbPort = false
int intOpenPortRtn = 0
int rtnTemp = 0
int pucIIN = 0
int pucSN = 0
int puiCHMsgLen = 0
int puiPHMsgLen = 0
objEDZ = new clsEDZ()
//检测usb口的机具连接,必须先检测usb
for (int iPort = 1001iPort <= 1016iPort++)
{
intOpenPortRtn = SDT_OpenPort(iPort)
if (intOpenPortRtn == 144)
{
EdziPortID = iPort
bUsbPort = true
break
}
}
//检测串口的机具连接
if (!bUsbPort)
{
for (int iPort = 1iPort <= 2iPort++)
{
intOpenPortRtn = SDT_OpenPort(iPort)
if (intOpenPortRtn == 144)
{
EdziPortID = iPort
bUsbPort = false
break
}
}
}
if (intOpenPortRtn != 144)
{
MessageBox.Show("端口打开失败,请检测相应的端口或者重新连接读卡器!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
return false
}
对于电脑调用手机NFC扫描身份z,需要满足以下条件:1. 手机支持NFC功能且已开启;
2. 电脑与手机连接在同一局域网内并已开启共享功能;
3. 安装了支持NFC读取的应用程序或浏览器插件;
4. 具备NFC芯片的身份z。姿返坦
步骤如下:
1. 首先,确保手机和电脑连接在同一局域网内,并且已将共享功能打开;
2. 在手机上打开NFC功能,将身份z放在手机背面,确保身份z芯片与手世扒机NFC芯片有足够的接触面积;
3. 通过NFC读取应用程序或浏览器插件,将身份z信息传输到电脑端。
需要注意的是,每个NFC设备的具体 *** 作方法可能不同,具体 *** 作可以根据实际情况迹桐进行调整。同时,确保使用的应用程序或浏览器插件是正规安全的,以避免信息泄露的风险。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)