Imports System.IO Public Class Form1 Private favoriteFile As String = "お気に入りのファイル" Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ReadFavorite() End Sub Private Sub ReadFavorite() Me.ListBox1.Items.AddRange(File.ReadAllLines(favoriteFile)) End Sub Private Sub AddFavorite(ByVal url As String) Me.ListBox1.Items.Add(url) End Sub Private Sub SaveFavorite() File.WriteAllLines(favoriteFile, Me.ListBox1.Items.Cast(Of String).ToArray()) End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AddFavorite(Me.WebBrowser1.Url.ToString()) End Sub Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed SaveFavorite() End Sub End Class