Imports System.IO
Public Class clsLog
Dim m_filename As String = ""
Private m_sw As StreamWriter = Nothing
Private m_bAppend As Boolean
Public Sub New(ByVal strPathLogFile As String, Optional ByVal bAppend As Boolean = True)
m_filename = strPathLogFile
m_bAppend = bAppend
Try
m_sw = New StreamWriter(m_filename, bAppend)
m_sw.Close()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
Protected Overrides Sub Finalize()
Dispose()
MyBase.Finalize()
End Sub
Private Sub Dispose()
Try
m_sw = Nothing
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
Public Sub Log(strValue As String)
Try
m_sw = New StreamWriter(m_filename, m_bAppend)
m_sw.WriteLine(strValue)
m_sw.Flush()
m_sw.Close()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try
End Sub
Public Sub ShowLog()
If System.IO.File.Exists(m_filename) Then
Process.Start(m_filename)
End If
End Sub
End Class
Suscribirse a:
Enviar comentarios (Atom)
VBA Access. Redondeo de números decimales con el método medio redondeo. Alternativa a la función Round (bankers round)
Private Function Redondeo(ByVal Numero As Variant, ByVal Decimales As Integer) As Double 'Aplica método medio redondeo (half round ...
-
Option Compare Database Option Explicit '***************************** ' 'Ejemplo de uso ' 'selecciona 1 ficher...
-
Option Compare Database Option Explicit 'Zip / UnZip file or folder 'http://www.codekabinett.com/rdumps.php?Lang=2&targetDoc...
No hay comentarios:
Publicar un comentario