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 |
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)
{
}
}
} |