![]() ![]() ![]() ![]() |
|||||
|
|||||
¼Ó¥D elsie ![]()
![]() |
sec 1 block 0 ID sec 1 block 1 NAME sec 1 block 2 DATE sec 2 block 0 POINT ì¥ý¥u¥i¥HŪ¨ú³æ¤@sec n¦p¦ó¥i¥HŪ¨ú¦hÓsec¨úÈ §â4Ó¸ê®Æ±a¨ìµe±¤W? public void BtnReadData_Click(object sender, EventArgs e) { string SNum = "-1", BNum = "-1", KType = "-1"; //°Ñ¼Æ¹w³] SNum = Sector.Text; BNum = Block.Text; if (KeyAB.Text == "A") //¿ï¾Ü key A,B { KType = "60"; } else { KType = "61"; } string ReadCmd = "020A15"; //Ū¨úcommend 0x02, 0x0A, 0x15, string TX = ReadCmd + KType + LoadKey.Text + SNum + BNum; UInt32 uiLength, uiRead, uiResult, uiWritten; byte[] ReadBuffer = new byte[0x40]; byte[] WriteBuffer = StringToByteArray(TX); byte[] sResponse = null; sResponse = new byte[21]; EasyPOD.VID = 0xe6a; EasyPOD.PID = 0x317; Index = 1; uiLength = 64; fixed (MW_EasyPOD* pPOD = &EasyPOD) { dwResult = PODfuncs.ConnectPOD(pPOD, Index); if ((dwResult != 0)) { MessageBox.Show("Not connected yet"); } else { EasyPOD.ReadTimeOut = 200; EasyPOD.WriteTimeOut = 200; dwResult = PODfuncs.WriteData(pPOD, WriteBuffer, 12, &uiWritten); uiResult = PODfuncs.ReadData(pPOD, ReadBuffer, uiLength, &uiRead); tebReadData.Text = BitConverter.ToString(ReadBuffer, 4,(Int32)uiRead - 4).Replace("-", ""); } dwResult = PODfuncs.ClearPODBuffer(pPOD); dwResult = PODfuncs.DisconnectPOD(pPOD); } } |