mCore™ .NET SMS Library 1.2

mCore.SMS.LogSize Property

Description:

The LogSize property gets the size of the log file in number of lines. This property can be used to monitor the size of the log file and clearing it accordingly.

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

Exceptions:

mCore.GeneralException

Usage Example:

Visual Basic

Public Class MyClass
   Public WithEvents objSMS As New mCore.SMS

   Public Sub InitializeLog()
      Try
         objSMS.LogFolderPath = "C:\MyLogs"
         If objSMS.LogSize > 500 Then
            objSMS.ClearLog(10)
         End If
         objSMS.LogType = mCore.LogType.ErrorEventLog

      Catch ex As mCore.GeneralException
         MsgBox(ex.Message, MsgBoxStyle.Critical, "mCore Demo")

      Catch ex As Exception

      End Try
   End Function
End Class

 
C#
class MyClass
{
   public mCore.SMS objSMS = new mCore.SMS();
   public static void InitializeLog()
   {
      try
      {
         objSMS.LogFolderPath = "C:\\MyLogs";
         if (objSMS.LogSize > 500)
         {
            objSMS.ClearLog(10);
         }
         objSMS.LogType = mCore.LogType.ErrorEventLog;
      }

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

See Also:

mCore.SMS.LogType Property
mCore.SMS.LogFolderPath Property
mCore.SMS.DebugMode Property
mCore.SMS.ClearLog Method

 

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved