PHP beginner |
|
Map aanmaken
Public Sub CreateIni(ByVal File As String, Optional ByVal msg As Boolean = False)
Dim objFileCreate As New System.IO.StreamWriter(File, False)
' Hier wil ik de file verborgen aanmaken
objFileCreate.Close()
If msg = True Then
MsgBox("File Created Succesfully!", MsgBoxStyle.OkOnly)
End If
Public Sub CreateIni (ByVal File As String, Optional ByVal msg As Boolean = False) Dim objFileCreate As New System. IO. StreamWriter(File, False) ' Hier wil ik de file verborgen aanmaken objFileCreate.Close() If msg = True Then MsgBox("File Created Succesfully!", MsgBoxStyle.OkOnly) End If
Bestand aanroepen, en lijn eruit filteren
Dim lTopMost As String = INI.FilterLine(SetDir & SetFile, "TopMost")
' hier roep ik het bestand aan.
Dim lTopMost As String = INI.FilterLine(SetDir & SetFile, "TopMost") ' hier roep ik het bestand aan.
en dit is het filterline functie waar een parameter bij moet of het bestand verborgen is ja of te nee.
Public Function FilterLine(ByVal file As String, ByVal startWith As String)
Dim objReader As New System.IO.StreamReader(file)
Dim Line As String
Dim LineAfter As String = ""
Dim i As Integer = 1
Do While objReader.Peek() <> -1
Line = objReader.ReadLine()
Line.ToString()
If Line.StartsWith(startWith) Then
LineAfter = Line
End If
Loop
objReader.Close()
Return LineAfter
End Function
Public Function FilterLine (ByVal file As String, ByVal startWith As String) Dim objReader As New System. IO. StreamReader(file) Dim Line As String Dim LineAfter As String = "" Dim i As Integer = 1 Do While objReader.Peek() <> -1 Line = objReader.ReadLine() Line.ToString() If Line.StartsWith(startWith) Then LineAfter = Line End If Loop objReader.Close() Return LineAfter End Function
|