Hi All,

the following article talks about how to get info from the SIM card. I
downloaded the sample, used the Phone.cs in an application, and everytime i
try to access the card i get "Can't read the service provider"

here's the code i am using:
using Microsoft.Wireless;

//application inits etc

private void button1_Click(object sender, System.EventArgs e)

{

string szOwnerNumber = "";

try

{

szOwnerNumber =
Microsoft.Wireless.Sim.GetServiceProvider();//Microsoft.Wireless.Sim.GetPhon
eNumber().ToString();

textBox1.Text = szOwnerNumber;

}

catch (Exception exp)

{

textBox1.Text = exp.Message;

}

}

is there something that i am missing or something?

I am using T-Mobile XDA-I upgraded to Windows Mobile 2003 (T-Mobile build)

thanks

mustafa

Re: Accessing SIM card from C# by Peter

Peter
Fri Jul 09 08:47:14 CDT 2004

Have you tried OpenNETCF.Phone.Sim functionality:-
http://www.opennetcf.org/library/OpenNETCF.Phone.Sim.html

Can you post a link to the article where you found this code, I'm not
familiar with a GetServiceProvider call.


Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"Mustafa Rabie" <mrabie007@hotmail.com> wrote in message
news:OO3GrMbZEHA.1480@TK2MSFTNGP10.phx.gbl...
> Hi All,
>
> the following article talks about how to get info from the SIM card. I
> downloaded the sample, used the Phone.cs in an application, and everytime
> i
> try to access the card i get "Can't read the service provider"
>
> here's the code i am using:
> using Microsoft.Wireless;
>
> //application inits etc
>
> private void button1_Click(object sender, System.EventArgs e)
>
> {
>
> string szOwnerNumber = "";
>
> try
>
> {
>
> szOwnerNumber =
> Microsoft.Wireless.Sim.GetServiceProvider();//Microsoft.Wireless.Sim.GetPhon
> eNumber().ToString();
>
> textBox1.Text = szOwnerNumber;
>
> }
>
> catch (Exception exp)
>
> {
>
> textBox1.Text = exp.Message;
>
> }
>
> }
>
> is there something that i am missing or something?
>
> I am using T-Mobile XDA-I upgraded to Windows Mobile 2003 (T-Mobile build)
>
> thanks
>
> mustafa
>
>



Re: Accessing SIM card from C# by Mustafa

Mustafa
Fri Jul 09 18:29:07 CDT 2004

Hi Peter,

that's the link for the article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfphoneapi.asp

i have tried using the OpenNETCF.Phone.Sim but i always get an error
whenever i run the application, and click the button that calls the
SIM.OwnNumbers i get the following error
System.TypeLoadException in System.Windows.Forms.dll, addicional information
: unable to load the type OpenNETCF.Phone.Sim.Sim from OpenNETCF.Phone
Namespace, Version=0.5.1627.32363, Culture=Neutral, PublicKeyToken=null.

private void button1_Click(object sender, System.EventArgs e)

{

textBox1.Text = "test";

try

{

OpenNETCF.Phone.Sim.Sim mySIM = new Sim();

textBox1.Text = mySIM.OwnNumbers.ToString();

}

catch(Exception exp)

{

textBox1.Text = exp.Message;

}

// textBox1.Text = mySMS.GetPhoneNumber();

}

and actually that happens with almost all the OpenNETCF.Phone functions,
SMS, SIM everything. I posted msgs on their forum but no reply, if you can
point me to the problem i'd really appreciate it.

Thanks a lot for your help
Mustafa Rabie


"Peter Foot [MVP]" <feedback@nospam-inthehand.com> wrote in message
news:eScB8sbZEHA.712@TK2MSFTNGP11.phx.gbl...
> Have you tried OpenNETCF.Phone.Sim functionality:-
> http://www.opennetcf.org/library/OpenNETCF.Phone.Sim.html
>
> Can you post a link to the article where you found this code, I'm not
> familiar with a GetServiceProvider call.
>
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com | www.opennetcf.org
>
> "Mustafa Rabie" <mrabie007@hotmail.com> wrote in message
> news:OO3GrMbZEHA.1480@TK2MSFTNGP10.phx.gbl...
> > Hi All,
> >
> > the following article talks about how to get info from the SIM card. I
> > downloaded the sample, used the Phone.cs in an application, and
everytime
> > i
> > try to access the card i get "Can't read the service provider"
> >
> > here's the code i am using:
> > using Microsoft.Wireless;
> >
> > //application inits etc
> >
> > private void button1_Click(object sender, System.EventArgs e)
> >
> > {
> >
> > string szOwnerNumber = "";
> >
> > try
> >
> > {
> >
> > szOwnerNumber =
> >
Microsoft.Wireless.Sim.GetServiceProvider();//Microsoft.Wireless.Sim.GetPhon
> > eNumber().ToString();
> >
> > textBox1.Text = szOwnerNumber;
> >
> > }
> >
> > catch (Exception exp)
> >
> > {
> >
> > textBox1.Text = exp.Message;
> >
> > }
> >
> > }
> >
> > is there something that i am missing or something?
> >
> > I am using T-Mobile XDA-I upgraded to Windows Mobile 2003 (T-Mobile
build)
> >
> > thanks
> >
> > mustafa
> >
> >
>
>