Hello below is a sub that writes a bunch of information to a file.
Basicly it is in a way a 'save' method for my application. I now want to create a 'load' so to do this i will have to reverse this process, how may i do this? Note that since i am recording info through a for each loop the loops and the means of how information is retrieved must be in the same order.
Here is my code:
vb Code:
'Here: Private Sub AddCustomer() Dim Customer_Info As New List(Of String) For Each ctrl As Control In Me.CustomerEditArea.Controls If Not (TypeOf (ctrl) Is Label) And Not (TypeOf (ctrl) Is CheckBox) And Not (TypeOf (ctrl) Is DateTimePicker) Then Customer_Info.Add(ctrl.Text.Trim) End If Next Customer_Info.Add(DateSelecter.Value.ToString) For Each chk As CheckBox In Me.CustomerEditArea.Controls If TypeOf (chk) Is CheckBox Then Customer_Info.Add(chk.CheckState.ToString) End If Next Customer_Info.Add(lblsubtotal.Text) Customer_Info.Add(lbltotal.Text) IO.File.WriteAllLines(ProfileDirectory & txtfirstname.Text.Trim & txtlastname.Text.Trim & ".ERcr", Customer_Info.ToArray) End Sub




Reply With Quote