Ok, what am i doing wrong? I have a text box that the user enters employees names and when you press the write button it saves each name entered into the text box to a text file on seperate lines. When I hit the write button it locks up my computer. Help!!!
VB.NET:
Private Sub writeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles writeButton.Click
' writes the contents of the list box to a sequential access file
Dim name As String = "Names"
Dim path As String = "C:\Documents and Settings"
If My.Computer.FileSystem.FileExists(path & "names.txt") Then
My.Computer.FileSystem.WriteAllText(path & "names.txt", String.Empty, False)
End If
Do While name <> String.Empty
nameTextBox = nameTextBox
My.Computer.FileSystem.WriteAllText("names.txt", name & ControlChars.NewLine, True)
Loop
End Sub