|
-
Feb 4th, 2011, 11:38 AM
#1
Thread Starter
Junior Member
[RESOLVED] Create a new line in a .dat file
I am trying to save data from some textboxes that I have on a form using this code:
Code:
Private Sub AddClientBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddClientBtn.Click
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "date_" & CalendarBRM.Text, True)
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "clientName_" & ClientNameBoxBRM.Text, True)
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "policyType_" & PolicyTypeBoxBRM.Text, True)
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "annualPremium_" & AnnualPremiumBoxBRM.Text, True)
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "agentCsr_" & AgentCsrBoxBRM.Text, True)
End Sub
It adds the information from the text boxes just fine, but the information is all on the same line. Is there any way to make each one go to a different line?
Last edited by Boots13; Feb 4th, 2011 at 12:04 PM.
-
Feb 4th, 2011, 11:44 AM
#2
Re: Create a new line in a .dat file
If you know up front the values you want to write, you can write them all as per this example in the help files.
Or you could just append a vbNewLine to the end of each of your data items
Code:
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "date_" & CalendarBRM.Text & vbNewLine, True)
-
Feb 4th, 2011, 12:00 PM
#3
Thread Starter
Junior Member
Re: Create a new line in a .dat file
 Originally Posted by Grimfort
If you know up front the values you want to write, you can write them all as per this example in the help files.
Or you could just append a vbNewLine to the end of each of your data items
Code:
My.Computer.FileSystem.WriteAllText("G:\Stuff\Lender Ins Files\ProductionReports.dat", "date_" & CalendarBRM.Text & vbNewLine, True)
Thanks you! I was trying to use vbNewLine but I wasn't sure where to put it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|