card reader for pocket pc

  • Thread starter Thread starter Mortar
  • Start date Start date
What exactly are you trying to do? Just read/write a file to the card,
make sure the card is in, etc?

I've done it with an SD memory chip but not a card with an embedded
chip (smart card).

Brett
 
This only pertains to an SD memory card. Read from the card just as
you do from a desktop hard disk. Check if a directory exists on the
card, which you know should. If the directory isn't there, prompt the
user to insert the card. Poll that condition on a seperate thread and
prompt the user a certain number of times on the insert card condition.

Your file IO may look like this for a simple read of the first line:

public const string SD_CARD_LOCATION = @"\Storage Card";

if(Directory.Exists(SD_CARD_LOCATION))
{
StreamReader sr = null;
try
{
sr = new StreamReader(SD_CARD_LOCATION + @"\myFile");
currentDeviceId = sr.ReadLine().Trim();
}
catch(Exception)
{
}
finally
{
if(sr != null)
{
sr.Close();
}
}
}

Hope it helps.

Brett
 
Thanks but I'm already familiar with memory card read/writing. I
really need to know how to read from a smart card.
 
Back
Top