crazymarvin
Member
Hey, I want to save a file in a directory, but i needa do this multiple times.
I put this code under the form load event
and im putting this for a button click event
I need a way of stopping it from changing the directory every time, as at the moment what happens is it looks for, "\Orders\06-15-06\" the first time, and "\Orders\06-15-06\Orders\06-15-06\" the second time.
Can anyone help?
thanks, Martyn
I put this code under the form load event
VB.NET:
If Directory.Exists("Orders\") Then
Exit Sub
Else : Directory.CreateDirectory("Orders\" & DateString)
End If
and im putting this for a button click event
VB.NET:
filename = txtboxON.Text & " " & Mid(txtboxName.Text, 1, 1) & ".txt"
Directory.SetCurrentDirectory("Orders\" & DateString)
FileOpen(1, filename, OpenMode.Output)
PrintLine(1, "Order Details")
PrintLine(1)
PrintLine(1, "Order Number:", txtboxON.Text)
PrintLine(1)
PrintLine(1, "Customer Name:", txtboxName.Text)
PrintLine(1)
PrintLine(1, "Address:", txtboxAdd.Text)
PrintLine(1)
PrintLine(1, "Post Code:", txtboxAdd2.Text)
PrintLine(1)
PrintLine(1, "Telephone Number", txtboxTel.Text)
PrintLine(1)
PrintLine(1, "Shape:")
PrintLine(1, txtboxShape.Text)
PrintLine(1)
PrintLine(1, "Total Cost:", txtboxCost.Text)
FileClose(1)
I need a way of stopping it from changing the directory every time, as at the moment what happens is it looks for, "\Orders\06-15-06\" the first time, and "\Orders\06-15-06\Orders\06-15-06\" the second time.
Can anyone help?
thanks, Martyn