Hanson.SmartCardReader
2.0.0
dotnet add package Hanson.SmartCardReader --version 2.0.0
NuGet\Install-Package Hanson.SmartCardReader -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Hanson.SmartCardReader" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hanson.SmartCardReader --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Hanson.SmartCardReader, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Hanson.SmartCardReader as a Cake Addin #addin nuget:?package=Hanson.SmartCardReader&version=2.0.0 // Install Hanson.SmartCardReader as a Cake Tool #tool nuget:?package=Hanson.SmartCardReader&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
README
Hanson.SmartCardReader
主要功能
- 取得系統所有讀卡機資訊
- 提供讀取晶片卡廠商資訊
- 提供讀取特定卡片資訊
前置條件
- 開發環境需具備 NET 472 or NET 462
- 運行於 Windows Platform (x86, x64)
安裝方式
- 採用 Nuget 方式進行安裝作業 https://www.nuget.org/packages/Hanson.SmartCardReader/
授權
此專案採用的 License為 Apache-2.0
使用範例
命名空間
using Hanson.SmartCardReader;
- 取得所有讀卡機 相關使用範例
private void Sample()
{
string[] readers = CardReaderFactory.GetReaderList();
if (readers.Length == 0)
{
Console.WriteLine("未插入讀卡機");
}
else
{
foreach (var item in readers)
{
Console.WriteLine($"讀卡機{item}");
}
}
}
- 讀取卡片資訊相關使用範例
private void Sample()
{
string readerName = "Generic Smart Card Reader Interface 0";
using (var reader = CardReaderFactory.CreateInstance(SmartCardType.HealthCardTw, readerName))
{
reader.Start();
reader.OnCardInsertedEvent += (x) =>
{
var infos = reader.GetCardInfo();
Console.WriteLine(infos.ToJsonSerialize());
};
reader.OnCardRemovedEvent += (x) =>
{
Console.WriteLine($"Reader:{x} 移出卡片");
};
Console.ReadKey();
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.6.2
- Hanson.Common.Extensions (>= 1.0.0)
- Hanson.NLog.Config (>= 1.1.0)
-
.NETFramework 4.7.2
- Hanson.Common.Extensions (>= 1.0.0)
- Hanson.NLog.Config (>= 1.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 140 | 4/16/2024 |