This Site will help you out a great deal. The best way to do this is something like:
Dim oFile as System.IO.File
Dim oWrite as System.IO.StreamWriter
oWrite = oFile.CreateText(“C:\sample.txt”)
oWrite.WriteLine(“{0,10}{1,10}{2,25}”, “Date”, “Time”, “Price”)
oWrite.WriteLine(“{0,10:dd MMMM}{0,10:hh:mm tt}{1,25:C}”, Now(), 13455.33)
oWrite.Close()
Here, if you mess with the numbers that are inside the {}, you can adjust exactly where in the text file you want the data to go....If this solution doesn't work (but it should) we can try one more (ugly) way.
Hi Guys Thanks for sharing Valuable information.
With ur Precious Help & time , my problem is HALF SOLVED
My Project will be completed if i can overcome this problem through valuable help from u guys.
Below is the coding:
***************************************************
Private Sub btnnotepad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnotepad.Click
Dim filename As String = "C:\Documents and Settings\Acer\Desktop\CounsellingSystem\Counsellrecords.txt"
Dim objwriter As New System.IO.StreamWriter(filename, True)
objwriter.WriteLine("{0,5}{1,30}{2,15}{3,15}{4,15}{5,15}", txtname.Text, txtnpos.Text, txtcname.Text, txtcpos.Text, DateTimePickerdoc.Value.ToShortDateString, DateTimePickerrd.Value.ToShortDateString)
objwriter.Close()
MsgBox("Record Saved To Notepad")
End sub
******************************************************
Please See attachment