 |
|
รบกวนช่วยแปลง c# เป็น VB ให้หน่อยครับ อ่านข้อมูลรูปภาพในบัตรสมาร์ทการ์ด |
|
 |
|
|
 |
 |
|
ต้องการดึงข้อมูลรูปจากบัตร ปชช สมาร์ทการ์ดครับ
ต้อนนี้ดึงข้อมูลมาได้ทุกอย่าง ชื่อนามสกุล เลขบัตรประชาชน วดป เกิด
แต่ตรงรูปติดตรงคำสั่ง ADPU Command ครับ
ไปเจอวิธีมาแต่ยังทำไม่ได้ครับ
Code (C#)
// photo
public CMD_PAIR[] GET_CMD_CARD_PHOTO()
{
CMD_PAIR[] cmds = new CMD_PAIR[21];
for (int i = 0; i <= 20; i++)
{
int xwd;
int xof = i * 254 + 379;
if (i == 20)
xwd = 38;
else
xwd = 254;
int sp2 = (xof >> 8) & 0xff;
int sp3 = xof & 0xff;
int sp6 = xwd & 0xff;
int spx = xwd & 0xff;
cmds[i].CMD1 = new byte[] { 0x80, 0xb0, (byte)sp2, (byte)sp3, 0x02, 0x00, (byte)sp6 };
cmds[i].CMD2 = new byte[] { 0x00, 0xc0, 0x00, 0x00, (byte)spx };
}
return cmds;
}
Tag : .NET, VB.NET, C#, Windows
|
|
 |
 |
 |
 |
Date :
2016-12-26 23:02:19 |
By :
phatlung |
View :
2993 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (VB.NET)
Public Function GET_CMD_CARD_PHOTO() As CMD_PAIR()
Dim cmds As CMD_PAIR() = New CMD_PAIR(20) {}
For i As Integer = 0 To 20
Dim xwd As Integer
Dim xof As Integer = i * 254 + 379
If i = 20 Then
xwd = 38
Else
xwd = 254
End If
Dim sp2 As Integer = (xof >> 8) And &Hff
Dim sp3 As Integer = xof And &Hff
Dim sp6 As Integer = xwd And &Hff
Dim spx As Integer = xwd And &Hff
cmds(i).CMD1 = New Byte() {&H80, &Hb0, CByte(sp2), CByte(sp3), &H2, &H0, _
CByte(sp6)}
cmds(i).CMD2 = New Byte() {&H0, &Hc0, &H0, &H0, CByte(spx)}
Next
Return cmds
End Function
Ref : http://codeconverter.sharpdevelop.net/SnippetConverter.aspx
|
ประวัติการแก้ไข 2016-12-27 08:16:23
 |
 |
 |
 |
Date :
2016-12-27 08:15:39 |
By :
mee079 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|