''' <summary>
''' Laden der Programm-Parameter
''' </summary>
Public Sub Parameter_Laden()
Dim Z, varListe() As String
Dim i As Integer
Dim Verzeichnis As String = GetFolderPath(SpecialFolder.ApplicationData)
If Not FolderExists(Verzeichnis) Then
My.Computer.FileSystem.CreateDirectory(Verzeichnis)
End If
Dim Datei As String = Verzeichnis + "\Daten.PAR"
Try
Dim fs As New FileStream(Datei, FileMode.Open,FileAccess.ReadWrite)
Dim CSV As New StreamReader(fs)
For i = 1 To 4
Z = CSV.ReadLine ' Header-Zeilen
Next
CSV.Close()
RaiseEvent Parameter_geladen()
Catch ex As Exception
End Try
End Sub
''' <summary>
''' Abspeichern der Programm-Parameter
''' </summary>
Public Sub Parameter_Speichern()
Dim Verzeichnis As String = GetFolderPath(SpecialFolder.ApplicationData)
If Not FolderExists(Verzeichnis) Then
My.Computer.FileSystem.CreateDirectory(Verzeichnis)
End If
Dim Datei As String = Verzeichnis + "\Daten.PAR"
Try
Dim fs As New FileStream(Datei, FileMode.Create, FileAccess.ReadWrite)
Dim CSV As New StreamWriter(fs)
CSV.WriteLine("Programm-Parameter :")
CSV.WriteLine("--------------------")
CSV.WriteLine("Stand : " + DatumString() + " " + Strings.Left(TimeString, 5))
CSV.WriteLine("--------------------")
CSV.Close()
Catch ex As Exception
End Try
End Sub
''' <summary>
''' Überprüfen, ob das Zielverzeichnis vorhanden ist
''' </summary>
Public Function FolderExists(ByVal FolderPath As String) As Boolean
Dim f As New IO.DirectoryInfo(FolderPath)
Return f.Exists
End Function
''' <summary>
''' Überprüfen, ob die Zieldatei vorhanden ist
''' </summary>
Public Function FileExists(ByVal FileFullPath As String) As Boolean
Dim f As New IO.FileInfo(FileFullPath)
Return f.Exists
End Function