i need help with setting files .ini
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
no prob...but next time please more info about what you wonna do and what u need to know
There is more than enough info given to say what is needed here.
Code: Select all
Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRead.Click
Dim lines As String() = File.ReadAllLines("file.ini")
For i As Integer = 0 To lines.Length - 1
If lines(i).StartsWith("Text1=") Then
TextBox1.Text = lines(i).Remove(0, 6)
ElseIf lines(i).StartsWith("Text2=") Then
TextBox2.Text = lines(i).Remove(0, 6)
End If
Next
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim content As String = "Text1=" & TextBox1.Text & vbCrLf _
& "Text2=" & TextBox2.Text
File.WriteAllText("file.ini", content)
End Sub
Copyright Information
Copyright © Codenstuff.com 2020 - 2023