• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write textbox text to a text file [VB.NET]
#1
In this tutorial I am going to show you how to write text to a file from TextBox. For example, you have some text in TextBox you want to save on your computer, you can do it by creating a text file.

The code is:

Code:
My.Computer.FileSystem.WriteAllText("C:\location\file.txt", TextBox1.Text, True)

Replace "C:\location\file.txt" with the location where the file should be created. It must be a .txt extension! Smile

True -> means it won't overwrite if the file is already existing. It'll keep original content.
False -> means if the file already exists, it will overwrite it.

Enjoy.
  Reply
#2
Doesn't need to be .txt at all..
[Image: nomnomnom.jpg]
;7$=v?%v%#5>v7v8994
The decrypt code is V, I could not make it any simpler!
  Reply
#3
Aye! Linux looks for a magic number!
Having long hair is great until you have to pull a footlong out of the dog's butt. flatank.blogspot.com
I. AM. LATCH.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading a Text File Into an Array of Lines in C Clones 0 9,630 13-11-2011, 01:21 PM
Last Post: Clones
  [VB.NET] Drag & Drop on Textbox Clones 1 8,683 11-11-2011, 07:13 PM
Last Post: Drumm
  [GIMP/Photoshop] Metallic Text Tutorial Clones 1 7,691 30-09-2011, 12:45 PM
Last Post: Mark
  PI text encrypter for the insomniac. latch 0 5,359 16-08-2011, 04:25 AM
Last Post: latch

Forum Jump: