Accessing SIM Information in C#

Started by thiruvasagamani, May 23, 2009, 08:01 PM

Previous topic - Next topic

thiruvasagamani

Accessing SIM Information in C#

Though by no means an exhaustive exploration of the SIM access functions available on the Pocket PC Phone Edition platform, we will take a look at how you can retrieve the SIM owner's primary phone number and service provider name, to further drive home the usefulness of P/Invoke. First we define a structure to hold the values received from pinging the SIM card as follows.
Copy Code

      [StructLayout(LayoutKind.Sequential)]
      private struct SimRecord
      {
         public IntPtr cbSize;
         public IntPtr dwParams;
         public IntPtr dwRecordType;
         public IntPtr dwItemCount;
         public IntPtr dwSize;
      }


Source : MSDN
Thiruvasakamani Karnan