making a .txt

When i click button_1, what code can i put in so it makes a .txt file thats called whatever is in textbox1 could someone help  




Answer this question

making a .txt

  • kMatsupy

    Try something like this



        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim sw As New System.IO.StreamWriter("C:\test.txt")
            sw.Write(TextBox1.Text)
            sw.Close()
        End Sub

     


  • rahul_sabharwal

    Or alternatively:

    My
    .Computer.FileSystem.WriteAllText("C:\test.txt", textbox1.text, False)



  • making a .txt