The NewMessageReceivedEventArgs class prepares data for the
NewMessageReceived event.
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
Inherits: System.EventArgs
| Property | Description | Type |
| Phone | SMS sender phone number | String |
| ReferenceNumber | Concatenated SMS reference number (valid if mCore.SMS.NewMessageConcatenate property is set as False, and will be same for all parts of same concatenated SMS) | Integer |
| SequenceNumber | Concatenated SMS sequence number (valid if mCore.SMS.NewMessageConcatenate property is set to False, and will range from 1 to TotalParts property | Integer |
| SMSC | Sender SMSC address | String |
| TextMessage | SMS text message | String |
| TimeStamp | SMS sending date and time | DateTime |
| TimeStampRFC | SMS sending date and time as RFC-822 format string | String |
| TimeZone | Time zone of SMS sender as difference in minutes between TimeStamp value and UTC | Integer |
| TotalParts | Total messages if this message is a part of a concatenated SMS (valid if mCore.SMS.NewMessageConcatenate property is set to False) | Integer |
| Visual Basic |
| Public Class MyClass Public WithEvents objSMS As New mCore.SMS Public Sub New() Try SetCommParameters() objSMS.NewMessageIndication = True objSMS.NewMessageConcatenate = True objSMS.AutoDeleteNewMessage = True Catch ex As mCore.GeneralException MsgBox(ex.Message) End Try End Sub 'New Message Event Handling 'A message box will pop-up whenever 'a new message is received Private Sub objSMS_NewMessageReceived(ByVal sender As Object, _ ByVal e As mCore.NewMessageReceivedEventArgs) _ Handles objSMS.NewMessageReceived MsgBox("FROM: " & e.Phone & vbCrLf & vbCrLf & _ "DATE/TIME: " & e.TimeStampRFC & vbCrLf & vbCrLf & _ "MESSAGE:" & vbCrLf & e.TextMessage, _ MsgBoxStyle.Information, "NEW MESSAGE RECEIVED") End Sub Public Sub SetCommParameters() Try objSMS.Port = "COM1" objSMS.BaudRate = mCore.BaudRate.BaudRate_19200 objSMS.DataBits = mCore.DataBits.Eight objSMS.StopBits = mCore.StopBits.One objSMS.Parity = mCore.Parity.None objSMS.FlowControl = mCore.FlowControl.RTS_CTS Catch ex As mCore.GeneralException MsgBox(ex.Message) Catch ex As Exception End Try End Function End Class |
| C# |
class MyClass { catch
(mCore.GeneralException e) |
mCore.SMS.NewMessageReceived Event
mCore.SMS.NewMessageReceivedEventHandler Delegate