There are two Textboxes & One button on mine form. I save the Textboxes
data to the TextFile on Button click.
I want the data in the TextFile as :
STUDENT RECORD INFORMATION
Roll : 1
Name : Ruchi
Roll : 2
Name : Ruchika
Mine Code is as Under-
Private Sub btnFixNow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFixNow.Click
Call SaveToTextFileOnFixNowButton(textbox1.text, textbox2.text)
End sub
Private Sub SaveToTextFileOnFixNowButton(ByVal Roll As String, ByVal Name As String)
Try
Dim FileNum As Integer
FileNum = FreeFile()
FileOpen(FileNum, "c:\BackUpFile.txt", OpenMode.Append)
PrintLine(FileNum, "Roll : & Roll)
PrintLine(FileNum, "Name : & Name)
FileClose(FileNum)
Catch ex As Exception
MsgBox("Error Occurred Under (SaveToTextFileOnFixNowButton) Procedure in (FrmMain.vb)" & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Mine O/P--
STUDENT RECORD INFORMATION
Roll : 1
Name : Ruchi
STUDENT RECORD INFORMATION
Roll : 2
Name : Ruchika
But I want the Output as Above, Can Somebody Help me Out.