save to file without SaveAsDialog

kornfreak900

New member
Joined
Feb 17, 2004
Messages
2
I have a bunch of information

(DateString, txtCustomerName.Text, txtCasesReturned.Text, txtBottlesReturned.Text, txtCasesCredited.Text, txtBottlesCredited.Text, cmbState.Text, txtGoodCust.Text, txtTypeCred.Text, txtSurchargeAmount.Text, txtTotal.Text)

that i want to be added to trans.txt file. i think i have to use the PrintLine Function, but it doesnt work. Can anyone help?
 
Got it

FileOpen(1, "trans.txt", OpenMode.Append)
PrintLine(1, System.DateTime.Now & "," & txtCustomerName.Text & "," & txtCasesReturned.Text & "," & txtBottlesReturned.Text & "," & txtCasesCredited.Text & "," & txtBottlesCredited.Text & "," & cmbState.Text & "," & txtGoodCust.Text & "," & txtTypeCred.Text & "," & txtSurchargeAmount.Text & "," & txtTotal.Text)
FileClose(1)
 
you need to be taking a look at the System.IO Class i think :) , you seem to be using out dated vb6 methods here.
try this ...
Code:
/// use the IO.StreamWriter to append to your file ( assuming it exists )
            Dim sWriter As New IO.StreamWriter(New IO.FileStream("C:\testing.txt", IO.FileMode.Append))
            sWriter.WriteLine(" your info here ")
            sWriter.Close()
 
Back
Top