Public Shared Function Trace(ByVal Message As String) As String
Dim Str As String
Str = DateTime.Now.Date
Dim FILE_NAME As String = "D:\R" + Str.Replace("/", "-") + ".txt"
Dim sw As StreamWriter
If System.IO.File.Exists(FILE_NAME) = True Then
System.Diagnostics.Process.GetProcessesByName(FILE_NAME)
sw = System.IO.File.AppendText(FILE_NAME)
sw.Write(DateTime.Now + "____________" + Message)
sw.WriteLine()
sw.Close()
Else
sw = File.CreateText(FILE_NAME)
End If
End Function
No comments:
Post a Comment