I'm trying to make a Windows Mobile (WinMo) application in C# to help all those affected by Alzheimers and similar conditions.
Part of it requires that an SMS text be sent using the number that is stored in a text file on my website.
I have got it to send the SMS text message, however when the program runs on the WinMo device, without "active sync" supplying internet, it crashes because it can't find internet, even though the phone has a constant data connection
The code I have so far is...
Expand|Select|Wrap|Line Numbers
- private void btn_send_Click(object sender, EventArgs e)
- {
- btn_send.Enabled = false;
- int i = 0;
- string fileline;
- HttpWebRequest reqFP = (HttpWebRequest)HttpWebRequest.Create("http://jamesgeddes.com/tracknan/phone.txt");
- HttpWebResponse rspFP = (HttpWebResponse)reqFP.GetResponse();
- Stream st = rspFP.GetResponseStream();
- using (StreamReader sr = new StreamReader(st))
- {
- fileline = sr.ReadLine();
- }
- SmsMessage x = new SmsMessage("fileline", "DONE");
- for (i = 0; i <= 10; i++)
- {
- label2.Text = Convert.ToString(i);
- x = new SmsMessage("fileline", Convert.ToString(i));
- x.Send();
- btn_send.Enabled = true;
- }
- }
Any help would be most appreciated, as it will help all those affected by Alzheimer's and related illnesses.
Thank you!
James