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.
15 posts Page 2 of 2
Contributors
User avatar
marve25
VIP - Donator
VIP - Donator
Posts: 40
Joined: Sun Sep 20, 2009 3:47 pm

ok, thanks
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

no prob...but next time please more info about what you wonna do and what u need to know
YouTube Downloader v3.0
Image
Image
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

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
User avatar
marve25
VIP - Donator
VIP - Donator
Posts: 40
Joined: Sun Sep 20, 2009 3:47 pm

Thanks mandai
User avatar
marve25
VIP - Donator
VIP - Donator
Posts: 40
Joined: Sun Sep 20, 2009 3:47 pm

Solved
15 posts Page 2 of 2
Return to “Tutorial Requests”