Writing New Text File

tk.unlimited

Active member
Joined
Apr 2, 2005
Messages
27
Programming Experience
1-3
Hey all!
Currently with my program everything i store in the listbox is stored in a textfile that i have already created...
HOWEVER is there possibly a way where if i input a name into a textbox that it will create a new textfile and save it as the name in the textbox?? :(
 
sure is possible

VB.NET:
Dim strName as String = txtName.Text 'txtName being the textbox used to type in the new file name
Dim swWrite as New System.IO.StreamWriter("C:\Whatever" & strName & ".txt")
swWrite.WriteLine("This is the new file with a custom name")
swWrite.Close
 
Back
Top