mirror of
https://github.com/jakobadam/RDSFactor.git
synced 2025-07-26 03:08:15 +02:00
Rename: RDSFactorWeb -> web, RDSFactor -> server
This commit is contained in:
parent
c3c10e1fd2
commit
eebdaf9551
88 changed files with 12 additions and 11 deletions
44
server/Log.vb
Normal file
44
server/Log.vb
Normal file
|
@ -0,0 +1,44 @@
|
|||
Imports System
|
||||
Imports System.IO
|
||||
Imports System.Data
|
||||
|
||||
Namespace LogFile
|
||||
Public Class LogWriter
|
||||
|
||||
|
||||
Public filePath As String
|
||||
Private fileStream As FileStream
|
||||
Private streamWriter As StreamWriter
|
||||
|
||||
Public Sub OpenFile()
|
||||
Try
|
||||
Dim strPath As String
|
||||
strPath = filePath
|
||||
If System.IO.File.Exists(strPath) Then
|
||||
fileStream = New FileStream(strPath, FileMode.Append, FileAccess.Write)
|
||||
Else
|
||||
fileStream = New FileStream(strPath, FileMode.Create, FileAccess.Write)
|
||||
End If
|
||||
streamWriter = New StreamWriter(fileStream)
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub WriteLog(ByVal strComments As String)
|
||||
Try
|
||||
OpenFile()
|
||||
streamWriter.WriteLine(strComments)
|
||||
CloseFile()
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub CloseFile()
|
||||
Try
|
||||
streamWriter.Close()
|
||||
fileStream.Close()
|
||||
Catch
|
||||
End Try
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
Loading…
Add table
Add a link
Reference in a new issue