Control File Naming

Zazoie

New member
Joined
Dec 19, 2007
Messages
4
Programming Experience
3-5
I am trying to create and name a new textfile from user input from a textbox

here is what I have so far but obviously it doesnt work. I'm not sure how to make the variable the name of the text file is what I am getting at...I guess. Ty for any help n advanced!

Chris

VB.NET:
Private Sub btnCreate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCreate.Click


        Dim fname As String
        fname = txtName.Text
        Dim oFile As System.IO.File
        Dim oWrite As System.IO.StreamWriter
        oWrite = oFile.CreateText("C:\Program Files\Lewt\Profile\& fname ".txt")
 
Last edited by a moderator:
To add two strings use the & operator, example:
VB.NET:
Dim s as string = "string 1" & "string 2"
 
Back
Top