Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I add Textbox1.Text to a textfile?
#1
How do I add Textbox1.Text to a textfile?
Reply
#2
I suppose you want to write text to file.
For VB check this link.
http://www.freevbcode.com/ShowCode.Asp?ID=4492

If you code in C# :
Code:
System.IO.StreamWriter streamWrite = new System.IO.StreamWriter("C:\\output.txt");
streamWrite.Write("lalala");
streamWrite.Close();
Reply
#3
Hey mate, I cant really explain it but read this tutorial and it should help.
Heres How you do it for VB.Net
http://www.vbtutor.net/vb2008/vb2008_lesson21.html
And for VB6
http://www.computing.net/answers/program.../7105.html
Sorry if that doesnt help.
Reply
#4
Solved:
Code:
Using sw As New System.IO.StreamWriter("C:\Sample.txt")    'Opens/creates file & StreamWriter object
    sw.WriteLine(TextBox1.Text)    'Outputs textbox value
End Using    'Closes & disposes StreamWriter object
Reply
#5
write this code in button click event

My.Computer.FileSystem.WriteAllText("Urfilepathname", TextBox1.Text, True)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What could i add to my browser? [Project] XDarkCoder 3 1,434 02-16-2013, 10:10 AM
Last Post: Swift Swim
  TextBox2.Text | Transfer Text to ListBox Die 3 2,664 01-02-2012, 06:09 PM
Last Post: AceInfinity
  How can i add a thread? Modestep 2 1,152 11-16-2011, 06:24 AM
Last Post: TalishHF
  Text Converter. Turn your text upside down! Red X 29 8,656 08-01-2011, 07:46 AM
Last Post: Red X
  textBox1 on form1 = label1 on form 2? GW19191 5 2,978 11-06-2010, 11:11 AM
Last Post: Resistance

Forum Jump:


Users browsing this thread: 1 Guest(s)