mCore™ .NET SMS Library 1.2

mCore.vCardException Class

Description:

The mCore.vCardException is thrown for any errors encountered during get/set of all properties or executing methods of mCore.vCard class.

Namespace: mCore
Assembly: mCoreLib (in mCoreLib.dll)
Inherits: System.Exception

Usage Example:

Visual Basic
Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub SendVCard()
      Dim objVCAL As mCore.vCalendar = objSMS.vCalendar
      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.SMS.EnumBaudRate.BaudRate_19200
         objSMS.DataBits = mCore.SMS.EnumDataBits.Eight
         objSMS.StopBits = mCore.SMS.EnumStopBits.One
         objSMS.Parity = mCore.SMS.EnumParity.None
         objSMS.FlowControl = mCore.SMS.EnumFlowControl.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.vCalendar objVCRD = 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.SMS.EnumBaudRate.BaudRate_19200;
         objSMS.DataBits = mCore.SMS.EnumDataBits.Eight;
         objSMS.StopBits = mCore.SMS.EnumStopBits.One;
         objSMS.Parity = mCore.SMS.EnumParity.None;
         objSMS.FlowControl = mCore.SMS.EnumFlowControl.RTS_CTS;
      }
      catch (mCore.GeneralException e)
      {
         MessageBox.Show(e.ToString());
      }
      catch (Exception e)
      {
      }
   }
}

See Also:

mCore.GeneralException Class
mCore.SMSDeleteException Class
mCore.SMSReadException Class
mCore.SMSSendException
mCore.vCalendarException Class
mCore.WapPushException Class

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved