.NET
  Home arrow .NET arrow Page 3 - Smart Cards in .NET
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Smart Cards in .NET
By: Digvijay Chauhan
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 102
    2004-03-15

    Table of Contents:
  • Smart Cards in .NET
  • The Solution
  • Three More Methods
  • A New Reference
  • The Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Smart Cards in .NET - Three More Methods


    (Page 3 of 5 )

    The following three methods provide the necessary UI components:

    1. SelectReader: Presents the user with a dialog that displays the available IFDs connected to the PC and allows selection of one.
    2. EjectCard: Presents the user with a dialog that notifies the user that the card can be removed safely from the reader.
    3. InsertCard: Presents the user with a dialog signifying that the reader can receive a card now.

    And the following five methods provide the way to easy smart card access:

    1. OpenReader
    2. CloseReader
    3. GetReaderName
    4. SetReaderName
    5. SendCommand

    I finalized all these UI items and methods after reviewing the PS/SC workgroup (http://www.pcscworkgroup.com) recommendations for implementing such a library. The specification is open and is available for free download at the website.

    The COM component is implemented as a DLL and it needs to be registered on the client machine, which can be done by simply running regsvr32.exe <DLL Name> at the command prompt.

    Once the component is registered you can use it in a variety of programming languages to access smart Card IFDs which are based on PC/SC specifications. I’m glad that most, if not all of the available Smart Card readers fall under this category. You can find three such usages in the samples accompanying this article.  Let’s move on to .NET and smart cards.

    Create a Windows Application in C# or VB.NET. Using the Add Reference … | COM Components tab locate the SCardLib 1.0 Type library and add it to your project. The following images will explain to you how to do it.

    Smart Cards 

    Smart cards

    More .NET Articles
    More By Digvijay Chauhan


     

    .NET ARTICLES

    - Building Applications with Windows Workflow ...
    - Building the Data and Business Layers Using ...
    - The Transformed XML Explorer in MFC
    - List Control and Property Grid with the MFC ...
    - Font, Shell and Masked Edit Controls for MFC
    - Color, Link and Image Editor Controls for M...
    - New Controls for MFC
    - The Windows Ribbon Framework
    - Markup Language for the Ribbon Framework
    - Visually Upgrade Your MFC Project
    - New Features for the Statusbar in MFC
    - Working with the Statusbar in MFC
    - Iron Speed Design v60 Review
    - Binary and XML Serialization
    - Using CrystalReportViewer to Display Crystal...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek