masj78
Active member
I am taking input from a text box and trying to write to a blank .txt file I already have saved on my C:\ drive, with the following:
Dim fileName As New System.IO.StreamWriter("C:\store.txt", True)
Dim strStore As String
-----------------------------------------------------------------------------
Private Sub cmdStore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStore.Click
Try
strStore = storeText.Text Text from text box
fileName.WriteLine(strStore)
fileName.Close()
Catch ex As Exception
MsgBox("Error Opening File!")
End Try
End Sub
The store.txt file is still blank, What am I doing wrong?
Dim fileName As New System.IO.StreamWriter("C:\store.txt", True)
Dim strStore As String
-----------------------------------------------------------------------------
Private Sub cmdStore_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStore.Click
Try
strStore = storeText.Text Text from text box
fileName.WriteLine(strStore)
fileName.Close()
Catch ex As Exception
MsgBox("Error Opening File!")
End Try
End Sub
The store.txt file is still blank, What am I doing wrong?