Public Function WriteLog(ByVal ex As Exception, ByVal Where As String) As Boolean
'Dim Path As String = "C:\Renergy Mini Data"
'dir.CreateDirectory(Path)
Dim fs As New FileStream(ErrFilePath, FileMode.Append, FileAccess.Write)
Dim s As New StreamWriter(fs)
s.WriteLine("DATE & TIME : " & System.DateTime.Now.Day & "-" & System.DateTime.Today.Month.ToString() & "-" & System.DateTime.Today.Year.ToString() & " -- " & System.DateTime.Now.Hour & ":" & System.DateTime.Now.Minute & ":" & System.DateTime.Now.Second & "")
s.WriteLine("ERROR MSG : " & ex.Message & "")
s.WriteLine("Occur At : " & Where & "")
s.WriteLine("- ~ -")
s.Close()
'Str = System.Reflection.Assembly.GetEntryAssembly.Location
'If Str.Contains("PO Entry New.exe") = True Then
' DBPath = Str.Replace("PO Entry New.exe", "RenergyPO.mdb")
' dllObj.ConnectDB(DBPath)
'End If
End Function
This post has been edited by smohd: 21 November 2011 - 03:54 AM
Reason for edit:: Code tags added. Please use [code] tags when posting codes

New Topic/Question
Reply



MultiQuote





|