Private Sub Form_Load() Dim fso, f1 Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.OpenTextFile(App.Path & "\config.txt", 1) Label1.Caption = f1.ReadLine Label2.Caption = f1.ReadLine Label3.Caption = f1.ReadLine Label4.Caption = f1.ReadLine End Sub Private Sub Form_Unload(Cancel As Integer) Dim fso, f1 Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.OpenTextFile(App.Path & "\config.txt", 2) f1.WriteLine Label1.Caption f1.WriteLine Label2.Caption f1.WriteLine Label3.Caption f1.WriteLine Label4.Caption End Sub
Private Sub Form_Load() Dim fso, f1 Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.OpenTextFile(App.Path & "\config.txt", 1) Label1.Caption = f1.ReadLine Label2.Caption = f1.ReadLine Label3.Caption = f1.ReadLine Label4.Caption = f1.ReadLine End Sub Private Sub Form_Unload(Cancel As Integer) Dim fso, f1 Set fso = CreateObject("Scripting.FileSystemObject") Set f1 = fso.OpenTextFile(App.Path & "\config.txt", 2) f1.WriteLine Label1.Caption f1.WriteLine Label2.Caption f1.WriteLine Label3.Caption f1.WriteLine Label4.Caption End Sub