Hi,
I want to create a Windows form with checkboxes, which will edit the configuration file of apache webserver. That’s a 437 lines text file, which means that each time I want to edit a setting, visual basic will have to find the correct line and make the appropriate modification.
I have have this code so far, that opens the file, and after the modifications, saves it.
But I still found no way of actually going to a specific line and making the change.
I want to create a Windows form with checkboxes, which will edit the configuration file of apache webserver. That’s a 437 lines text file, which means that each time I want to edit a setting, visual basic will have to find the correct line and make the appropriate modification.
I have have this code so far, that opens the file, and after the modifications, saves it.
VB.NET:
Dim f As Integer
Dim s As String
'load the whole file into a string variable
f = FreeFile()
Open "<filename>" For Binary As #f
s = Space$(LOF(f))
Get #f, , s
Close #f
'do the modifications here
'save the string variable into the file
Kill "<filename>"
f = FreeFile()
Open "<filename>" For Binary As #f
Put #f, , s
Close #f
But I still found no way of actually going to a specific line and making the change.