Public Class MyClass
Public WithEvents objSMS As New mCore.SMS
Public Sub SendVCard()
Dim objVCARD As mCore.vCard = objSMS.vCard
Try
SetCommParameters()
objVCARD.Destination =
"+919873094767"
objVCARD.FirstName = "John"
objVCARD.MiddleName = ""
objVCARD.LastName = "Doe"
objVCARD.Email = "john.doe@mycompany.com"
objVCARD.URL = "http://www.johndoe.com"
objVCARD.Company = "My Company"
objVCARD.JobTitle = "Project
Manager"
objVCARD.HomePhone =
"+911126457896"
objVCARD.BusinessPhone =
"+9123567852"
objVCARD.MobilePhone =
"+919865285263"
objVCARD.HomeAddressStreet = ""
objVCARD.HomeAddressCity = "New
Delhi"
objVCARD.HomeAddressState = ""
objVCARD.HomeAddressCountry =
"India"
objVCARD.HomeAddressZIP = ""
objVCARD.BusinessAddressStreet
= "XYZ Street"
objVCARD.BusinessAddressCity =
"New Delhi"
objVCARD.BusinessAddressState =
"Delhi"
objVCARD.BusinessAddressCountry
= "India"
objVCARD.BusinessAddressZIP =
"110011"
objVCARD.Comment = "Tax
Consultant"
'Send
the vCard
objVCARD.Send()
MsgBox("vCard sent!",
MsgBoxStyle.Information, strMyAppName)
Catch ex As mCore.vCardException
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.vCard objVCARD = objSMS.vCard();
try
{
SetCommParameters();
objVCARD.Destination =
"+919873094767";
objVCARD.FirstName = "John";
objVCARD.MiddleName = "";
objVCARD.LastName = "Doe";
objVCARD.Email = "john.doe@mycompany.com";
objVCARD.URL =
"http://www.johndoe.com";
objVCARD.Company = "My
Company";
objVCARD.JobTitle = "Project
Manager";
objVCARD.HomePhone =
"+911126457896";
objVCARD.BusinessPhone =
"+9123567852";
objVCARD.MobilePhone =
"+919865285263";
objVCARD.HomeAddressStreet =
"";
objVCARD.HomeAddressCity = "New
Delhi";
objVCARD.HomeAddressState = "";
objVCARD.HomeAddressCountry =
"India";
objVCARD.HomeAddressZIP = "";
objVCARD.BusinessAddressStreet
= "XYZ Street";
objVCARD.BusinessAddressCity =
"New Delhi";
objVCARD.BusinessAddressState =
"Delhi";
objVCARD.BusinessAddressCountry
= "India";
objVCARD.BusinessAddressZIP =
"110011";
objVCARD.Comment = "Tax
Consultant";
'Send
the vCard
objVCARD.Send();
MessageBox.Show("vCard sent!");
} catch (mCore.vCardException 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)
{
}
}
} |