Home > Back-end >  Get a new tablet (win10 system), want to ask next read how to use Delphi for NFC card number
Get a new tablet (win10 system), want to ask next read how to use Delphi for NFC card number

Time:11-04

If inscribe
Get a new tablet (win10 system),
Want to ask next read how to use Delphi for NFC card number,
Only need to read the card number

CodePudding user response:

NFC device is
NXP NearFieldProximity Provider

CodePudding user response:

Is there a big give a thought to also go

CodePudding user response:

Are the tablet provider for the SDK


If it is a universal NFCA type or B type, first to online for example JAVA (typically), and then go to DELPHI, or try to find examples of D directly

CodePudding user response:

Win10 since 10240 has built-in support for NFC device, Windows.Net working WinRT API. Proximity, reference: https://docs.microsoft.com/en-us/uwp/api/Windows.Networking.Proximity.ProximityDevice? Redirectedfrom=MSDN

Delphi about 10.0 from Seattle to support WinRT API, you need only USES WinAPI.Net working. The Proximity; Then copy the example of Microsoft is about

CodePudding user response:

There is a more detailed example: https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/NfcProvisioner/cs/Scenario1.xaml.cs

CodePudding user response:

reference 5 floor early play the play nuclear war response:
there is a more detailed example: https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/NfcProvisioner/cs/Scenario1.xaml.cs

Don't understand the c # 0.0
Small white a help to see like this a little problem

 
The unit Unit1;

Interface

USES the
Winapi. Windows, Winapi Messages, System. SysUtils, System. Variants,
System. The Classes, the Vcl. Graphics, Vcl. Controls, Vcl. Forms, Vcl. Dialogs,
Winapi.Net working. Proximity, Vcl StdCtrls, Vcl.Com Ctrls, Winapi. WinRT;

Type
TMessageReceivedHandler=class (TInterfacedObject MessageReceivedHandler)
Public
Procedure Invoke (sender: IProximityDevice; Message: IProximityMessage); Safecall;
end;

TForm1=class (TForm)
Label1: TLabel;
CbReader: TComboBox;
RbOutput: TRichEdit;
BtnInit: TButton;
BtnConnect: TButton;
The btnActive: TButton;
SendGroup: TGroupBox;
TbData: TMemo;
BtnClear: TButton;
BtnReset: TButton;
BtnQuit: TButton;
Procedure btnInitClick (sender: TObject);
Procedure FormClose (sender: TObject; Var Action: TCloseAction);
Procedure btnQuitClick (sender: TObject);
Procedure FormCreate (sender: TObject);
Private
{Private declarations}
Device: TProximityDevice;
NFCReader: IProximityDevice;
SubscribedMessageId: Int64;
MessageReceivedHandler: TMessageReceivedHandler;
Public
{Public declarations}
end;

Var
Form1: TForm1;

Implementation

{$R *. DFM}

Procedure TForm1. BtnInitClick (Sender: TObject);
Var
H: HSTRING;
The begin
Try
Device:=TProximityDevice. Create;
RbOutput. Lines. The Add (' Device. GetDeviceSelector: + IntToStr (Device. GetDeviceSelector));
NFCReader:=Device. GetDefault;
If (not Assigned (NFCReader)) then
The begin
FreeAndNil (NFCReader);
FreeAndNil (Device);
RbOutput. Lines. The Add (' no reader ');
The Exit;
end;
RbOutput. Lines. The Add (' Device. GetDefault. DeviceId + IntToStr (NFCReader. DeviceId));
//TODO: this HSTRING digital is why? Microsoft there is not a string
://h=HSTRING (1);
RbOutput. Lines. The Add (' h>> ');
If (not Assigned (MessageReceivedHandler)) then
The begin
MessageReceivedHandler:=TMessageReceivedHandler. Create;
RbOutput. Lines. The Add (' MessageReceivedHandler. Create>> ');
end;
If (SubscribedMessageId=1) then
The begin
//TODO: this line has a problem, an
SubscribedMessageId:=NFCReader SubscribeForMessage (h, MessageReceivedHandler);
end;
RbOutput. Lines. The Add (' SubscribedMessageId: + IntToStr (SubscribedMessageId));
Except,
On E: the Exception do
The begin
RbOutput. Lines. The Add (+ lassName of e.c. with our fabrication: 'error:' + '///' + E.M essage);
end;
end;
end;

Procedure TForm1. BtnQuitClick (Sender: TObject);
The begin
RbOutput. Lines. The Add (' FreeAndNil (MessageReceivedHandler) ');
Try
FreeAndNil (MessageReceivedHandler);
Except,
On E: the Exception do
The begin
RbOutput. Lines. The Add (+ lassName of e.c. with our fabrication: 'error:' + '///' + E.M essage);
end;
end;
RbOutput. Lines. The Add (' FreeAndNil (NFCReader) ');
Try
FreeAndNil (NFCReader);
Except,
On E: the Exception do
The begin
RbOutput. Lines. The Add (+ lassName of e.c. with our fabrication: 'error:' + '///' + E.M essage);
end;
end;
RbOutput. Lines. The Add (' FreeAndNil (Device) ");
Try
FreeAndNil (Device);
Except,
On E: the Exception do
The begin
RbOutput. Lines. The Add (+ lassName of e.c. with our fabrication: 'error:' + '///' + E.M essage);
end;
end;
end;

Procedure TForm1. FormClose (Sender: TObject; Var Action: TCloseAction);
The begin
RbOutput. Lines. The Add (' FreeAndNil (MessageReceivedHandler) ');
Try
FreeAndNil (MessageReceivedHandler);
Except,
On E: the Exception do
The begin
RbOutput. Lines. The Add (+ lassName of e.c. with our fabrication: 'error:' + '///' + E.M essage);
end;
end;
RbOutput. Lines. The Add (' FreeAndNil (NFCReader) ');
Try
FreeAndNil (NFCReader);
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related