Public Class Form4
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
ListBox1.Items.Add(InputBox("Masukkan jenama baru anda:"))
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim s As New IO.StreamWriter("toner.dbo")
For i As Integer = 0 To ListBox1.Items.Count - 1
s.Write(ListBox1.Items(i) & vbNewLine)
Next
s.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If IO.File.Exists("toner.dbo") Then
Dim r As New IO.StreamWriter("toner.dbo")
Dim txt As New TextBox
txt.Text = r.ReadToEnd
ListBox1.Items.Clear()
For i As Integer = 0 To txt.Lines.Count - 2
ListBox1.Items.Add(txt.Lines(i))
Next
r.Close()
End If
End Sub
End Class