Hello,
I need to convert the following code from C# to Vb.net (it's part of an EMV API).
--------------------------------------------------------------------------------------------------------
unsafe public uint InputPIN(ref byte pPinNum)
{
[login to view URL]("Input Password and Push Enter !");
[login to view URL]();
[login to view URL]();
if ([login to view URL])
{
string strPassword = Invoke(new GetPasswordTextCallback(GetPasswordText), new object[] { }).ToString();
byte[] byPassword = StrToByteArray(strPassword);
fixed (byte* _pPinNum = &pPinNum)
{
byte* ps = _pPinNum;
for (int i = 0; i < 4; i++)
*(ps + i) = byPassword[i];
}
}
return 1;
}
--------------------------------------------------------------------------------------------------------
The result would be like this:
--------------------------------------------------------------------------------------------------------
' InputPin
Public Function InputPIN(ByRef pPinNum As Byte) As UInteger
[login to view URL]("Input Password and Push Enter !")
[login to view URL]()
[login to view URL]()
If [login to view URL] Then
Dim strPassword As String = Invoke(New GetPasswordTextCallback(AddressOf GetPasswordText), New Object() {}).ToString()
Dim byPassword As Byte() = StrToByteArray(strPassword)
'... ???
End If
Return 1
End Function
--------------------------------------------------------------------------------------------------------
I am stuck with the conversion of the 'fixed' structure.
I think the functions needed are [login to view URL] and/or GCHandle