日志
Public Shared Sub WriteLog(ByVal strStyle As String, ByVal strContent As String)
Dim curDate As String = CDate(Now).ToString("yyyy-MM-dd HH:mm:ss")
Dim path As String = GetPath() & "\log"
If Not My.Computer.FileSystem.DirectoryExists(path) Then
My.Computer.FileSystem.CreateDirectory(path)
End If
path &= "\" & CDate(curDate).ToString("yyyyMMdd") & ".txt"
If Not My.Computer.FileSystem.FileExists(path) Then
My.Computer.FileSystem.WriteAllText(path, String.Empty, False)
End If
Dim strValue As String = String.Empty
strValue = "---" & curDate & "---" & vbCrLf
strValue &= "---操作类型[" & strStyle & "]---" & vbCrLf
strValue &= "---错误原因---" & vbCrLf
strValue &= strContent & vbCrLf & vbCrLf & vbCrLf
My.Computer.FileSystem.WriteAllText(path, strValue, True)
End Sub

浙公网安备 33010602011771号