SMS Receiving using DOTNET C#
- by sheery
Hi dears,
I have build an application using C# to send and receive sms, my application works fine for sending sms but when i try to read sms from my mobile through my application i get following error
"Error: Phone reports generic communication error or syntax error."
can any one help me in this matter,
my syntax for reading sms is
private void btnReadMessages_Click(object sender, System.EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
string storage = GetMessageStorage();
try
{
// Read all SMS messages from the storage
DecodedShortMessage[] messages = comm.ReadMessages(PhoneMessageStatus.All, storage);
foreach(DecodedShortMessage message in messages)
{
Output(string.Format("Message status = {0}, Location = {1}/{2}",
StatusToString(message.Status), message.Storage, message.Index));
ShowMessage(message.Data);
Output("");
}
Output(string.Format("{0,9} messages read.", messages.Length.ToString()));
Output("");
}
catch(Exception ex)
{
ShowException(ex);
}
Cursor.Current = Cursors.Default;
}