The Delete method deletes the particular message from the Inbox as well as
the GSM Modem/Phone memory. Returns a Boolean value True if the deletion was
successful. If not, it returns a Boolean value False.
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
mCore.SMSReadException
mCore.SMSDeleteException
mCore.GeneralException
| Visual Basic |
Public Class MyClass
Catch ex As mCore.SMSReadException If
objSMS.Inbox.HasMessages Then |
| C# |
| class MyClass { public mCore.SMS objSMS = new mCore.SMS(); public static void ReadInbox() { mCore.Message Msg; try { SetCommParameters(); objSMS.MessageMemory = mCore.SMS.EnumMessageMemory.ME; try { objSMS.Inbox().Refresh(); } catch (mCore.SMSReadException ex) { MessageBox.Show("Error reading Inbox!" + "\r\n" + ex.ToString());; } if (objSMS.Inbox().HasMessages) { MessageBox.Show("Total " + objSMS.Inbox().Count.ToString() + " messages"); foreach (mCore.Message Msg in objSMS.Inbox()) { MessageBox.Show("From: " + Msg.Phone + "[SMSC: " + Msg.SMSC + "]\r\n" + Msg.TimeStampRFC + "\r\n" + Msg.Text); } //The following loop is same as objSMS.Inbox().Clear() for (int i = objSMS.Inbox().Count; i >= 1; --i) { try { objSMS.Inbox().Message(i).Delete(); } catch (mCore.SMSDeleteException ex) { MessageBox.Show(e.ToString()); } } } } catch
(mCore.GeneralException e) catch
(mCore.GeneralException e) |
Inbox.Message(i) Method
Inbox.Clear Method