Skip to content
Xavier Averbouch edited this page Jan 16, 2020 · 1 revision

basic usage in C# ; example for nfc-scan-device.exe (DotNet Console App)

`

class Program

{ 

  static void Main(string[] args)`

  {  
      using (var ctx = new FreeFareContext())` 
      {  
        string codeBase = Assembly.GetExecutingAssembly().CodeBase;
        string name = Path.GetFileNameWithoutExtension(codeBase);
        Console.WriteLine($"{name} uses libnfc {ctx.Version()}");
        var lst = ctx.ListDeviceNames();
        Console.WriteLine($"{lst.Count} NFC device(s) found:");
        foreach (var d in lst)
            Console.WriteLine(d);
     }
}

}
`

Console display :

nfc-scan-device uses libnfc 1.7.1

1 NFC device(s) found:

acr122_usb:bus-0:\\.\libusb0-0255--0x072f-0x2200

Clone this wiki locally