Computing.Net > Forums > Programming > scardlocatecards:smart card api c#

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

scardlocatecards:smart card api c#

Reply to Message Icon

Name: leelavathi
Date: December 27, 2007 at 23:14:12 Pacific
OS: vista
CPU/Ram: p-IV and 1gb ram
Comment:

hi can anyone help me regarding the smart card API SCardLocateCardsW
here is the code i am sending which i have written
[DllImport("winscard.dll", SetLastError = true)]
internal static extern int SCardLocateCardsW(UInt32 hContext, [MarshalAs(UnmanagedType.LPTStr)] string mszCards, [In, Out] SCard_ReaderState[] rgReaderStates, int cReaders);
int nbReaders;
SCard_ReaderState[] readerState = new SCard_ReaderState[1];
// UInt32 eventState = readerState[0].m_dwEventState;
readerState[0].m_dwCurrentState = (UInt32)CARD_STATE.UNAWARE;
readerState[0].m_szReader = (string)reader;
nbReaders = readerState.Length;
string card1 = "Axalto Cryptoflex .NET";

//string[] card = { "Infineon SICRYPT CardModule Card", "Axalto Cryptoflex .NET" };
//card[0]= "Infineon SICRYPT CardModule Card";
//card[1]="Axalto Cryptoflex .NET";
//string card = "";
int nErrCode = SCardLocateCardsW(m_hContext,card1,readerState, nbReaders);

if (nErrCode != 0)
{
string msg = "Failed SCardLocateCardsA error: " + nErrCode;

throw new Exception(msg);
}
the code is throwing an error
i am not knowing wht to pass in the mszcards
can anyone help me
i need this
thanks in advance


leela



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: scardlocatecards:smart card api c#

reading data from smart card www.computing.net/answers/programming/reading-data-from-smart-card/7887.html

Read smart card using SCardTransmit www.computing.net/answers/programming/read-smart-card-using-scardtransmit/7908.html

sample math program with j2me www.computing.net/answers/programming/sample-math-program-with-j2me-/8479.html