我需要用新分数更新学生分数,但我无法将其写入学生当前分数的行。它只是删除整个文本。
Alex,letmein,0 David,qwerty1,0 John,password,0 Paul,lion,0 Luke,bennett,0 Ronald,Mcdonald,0 Erin,german,0 Laura,Scotland,0 Ross,extra,0 Alan,beverage,0
Try
fileName = "C:\Documents and Settings\Student\Desktop\Task10\primary4.txt"
Dim sWriter As New System.IO.StreamWriter(fileName)
index = lblPosition.Text
sWriter.Write(username(index))
sWriter.Write(",")
sWriter.Write(password(index))
sWriter.Write(",")
sWriter.WriteLine(updatescore(position)
sWriter.Close()
MessageBox.Show("Writing file to disk")
Me.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try