If you want to save the text written in a TextBox using Visual Basic 2010 in a Button write the code bellow:
Dim write As New System.IO.StreamWriter("Messages.txt")
write.Write(TextBox1.Text)
write.Close()
Get free Visual basic 2010 source codes. Learn Visual Basic 2010 using this website.
Showing posts with label Files. Show all posts
Showing posts with label Files. Show all posts
Tuesday, June 21, 2011
Monday, June 20, 2011
Read a Text File in TextBox
If you want to create a notepad you have to know how to read already written text file. To do this task use the code bellow:
Dim read As New System.IO.StreamReader("Test.txt")
TextBox1.Text = read.ReadToEnd
read.Close()
Dim read As New System.IO.StreamReader("Test.txt")
TextBox1.Text = read.ReadToEnd
read.Close()
Friday, May 13, 2011
Copy a Directory
My.Computer.FileSystem.CopyDirectory("C:\testdirectory", "D:\testdirectory")
Sunday, May 8, 2011
Copy File from one location to another
Write the code bellow:
My.Computer.FileSystem.CopyFile("C:\test.txt"), "D:\test.txt")
My.Computer.FileSystem.CopyFile("C:\test.txt"), "D:\test.txt")
Saturday, April 30, 2011
Copy a File
To copy one file from one location to another, you have to enter the code bellow:
My.Computer.FileSystem.CopyFile("C:\test.txt"), "D:\test.txt")
My.Computer.FileSystem.CopyFile("C:\test.txt"), "D:\test.txt")
Subscribe to:
Posts (Atom)