mCore™ .NET SMS Library 1.2

PictureSMS.Text Property

Description:

The Text property gets or sets the text message to send in the Picture SMS.

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)

Exceptions:

mCore.PictureSMSException
mCore.GeneralException

Usage Example:

Visual Basic

Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub SendPictureSMS()
      Dim objPicSMS As mCore.PictureSMS = objSMS.PictureSMS
      Try
         SetCommParameters()

         objPicSMS.Destination = "+919873094767"
         objPicSMS.BitmapFile = "C:\birthday.bmp"
         objPicSMS.Text = "Happy Birthday"

         'Send the vCard
         objPicSMS.Send()
         MsgBox("Picture SMS Sent!", MsgBoxStyle.Information, strMyAppName)

      Catch ex As mCore.PictureSMSException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")
      Catch ex As mCore.GeneralException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")
      Catch ex As Exception
      End Try
   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
{
   public mCore.SMS objSMS = new mCore.SMS();

   public static void SendVCard()
   {
      mCore.PictureSMS objPicSMS = objSMS.PictureSMS();
      try
      {

          SetCommParameters();

         objPicSMS.Destination = "+919873094767";
         objPicSMS.BitmapFile = "C:\\birthday.bmp";
         objPicSMS.Text = "Happy Birthday";

         'Send the vCard
         objPicSMS.Send();
         MessageBox.Show("Picture SMS Sent!");
      }

      catch (mCore.PictureSMSException e)
      {
         MessageBox.Show(e.ToString());
      }

      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }

   public static void 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 (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.SMS.PictureSMS Method
PictureSMS.BitmapFile Property
PictureSMS.Destination Property
PictureSMS.Send Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved