mCore™ .NET SMS Library
1.2
vCalendar.SendFile Method
Description:
The SendFile method reads the specified vCalendar file (.vcs file)
from the specified path on the disk and sends it as a vCalendar SMS to the
destination number specified in the
Destination property.
If the vCalendar message is long and cannot be sent as one single SMS, then it is split in to multiple parts and sent
as a concatenated SMS.
Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
Parameters:
vCalendarFile: The complete path for the vCalendar file
which is to be sent as SMS.
Remarks:
- Returns a string value indicating the message reference number(s).
- If the text message is longer than the maximum permissible size then it
is sent as concatenated multiple messages and
the message references of all the messages are returned separated by comma
(,). Delivery Status Report, if requested using
DeliveryReport
property, is returned only for the last message reference number.
- DestinationNumber can be either International format i.e. with
'+<Country Code>' as prefix (e.g. +919873094767) or National format i.e.
without country code prefix (e.g. 9873094767)
- The return type of this method has been changed
from version 1.0.67 onwards. Older versions returned a Boolean value
indicating if the message sending was success or failure.
Exceptions:
mCore.vCalendarException
mCore.GeneralException
Usage Example:
| Visual Basic |
Public Class MyClass
Public WithEvents objSMS As New mCore.SMS
Public Sub SendVCalendar()
Dim objVCAL As mCore.vCalendar = objSMS.vCalendar
Try
SetCommParameters()
objVCAL.Destination =
"+919873094767"
objVCAL.SendFile("c:\meeting.vcs")
MsgBox("vCalendar sent!",
MsgBoxStyle.Information, strMyAppName)
Catch ex As mCore.vCalendarException
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 SendVCalendar()
{
mCore.vCalendar objVCAL = objSMS.vCalendar();
try
{
SetCommParameters();
objVCAL.Destination =
"+919873094767"
objVCAL.SendFile("c:\meeting.vcs");
MessageBox.Show("vCalendar
sent!");
} catch (mCore.vCalendarException 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.vCalendar Method
vCalendar.Destination Property
Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved