大网数据广告活动
账户与安全

ISCard interface (Scardmgr.h)

· 52CE 我爱测

Lets you open and manage a connection to a smart card.

[The ISCard interface is available for use in the operating systems specified in the Requirements section. The Smart Card Modules provide similar functionality.]

The ISCard interface lets you open and manage a connection to a smart card. Each connection to a card requires a single, corresponding instance of the ISCard interface.

The smart card resource manager must be available whenever an instance of ISCard is created. If this service is unavailable, creation of the interface will fail.

The following example shows a typical use of the ISCard interface. The ISCard interface is used to connect to the smart card, submit a transaction, and release the smart card.

To submit a transaction to a specific card

  1. Create an ISCard interface.
  2. Attach to a smart card by specifying a smart card reader or by using a previously established, valid handle.
  3. Create transaction commands with ISCardCmd, and ISCardISO7816 smart card interfaces.
  4. Use ISCard to submit the transaction commands for processing by the smart card.
  5. Use ISCard to release the smart card.
  6. Release the ISCard interface.

Members

The ISCard interface inherits from the IDispatch interface. ISCard also has these types of members:

Methods

The ISCard interface has these methods.

Method Description
AttachByHandle Attaches an object to an open and configured smart card handle.
AttachByReader Opens the smart card in the named reader.
Detach Closes the open connection to the smart card.
LockSCard Claims exclusive access to the smart card.
ReAttach Resets and reinitializes the smart card.
Transaction Executes a write and read operation on the smart card command (application protocol data unit) object.
UnlockScard Releases exclusive access to the smart card.

Properties

The ISCard interface has these properties.

Property Access type Description
Atr Read-only Retrieves the ATR string of the smart card.
CardHandle Read-only Retrieves the handle for the connected smart card.
Context Read-only Retrieves the current resource manager context handle.
Protocol Read-only Retrieves the identifier of the protocol currently in use on the smart card.
Status Read-only Retrieves the current state the smart card is in.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
End of client support Windows XP
End of server support Windows Server 2003
Header Scardmgr.h
Type library Scardmgr.tlb
DLL Scardssp.dll
IID IID_ISCard is defined as 1461AAC3-6810-11D0-918F-00AA00C18068

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。