Hello to everyone, Im a beginner in vb.net and currently Im developing a "reminder" program, the user inserts a task that he as to do, the date and the time to be remimbered! Im saving the task in a txt file like this, "Make dinner,Reminder,24-07-2012 18:31:00", but line by line, each task in a diferent line.
The insert of the task and the pop up of the alarm are working fine, but i have a problem and that is, when the alarm goes one showing the task to the user and for some reason he needs to change something in the task, for that I thought in finding the line that contains the name of the task( this part is working) and replace the whole line with the one that haves the changes made by the user ( this part isn't working). I searched on google and in here but i was unable to put it to work.
So, how can i do this?
Heres the code that i have:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim line4, line5 As String For Each line As String In IO.File.ReadAllLines("C:\Users\Guilherme\Documents\database\data_base_tasks.txt") If line.Contains(TextBox3.Text) Then ' MsgBox("Found line" & line) this was to see if the line was found and it works line4 = line line5 = line4.Replace(line, TextBox1.Text & "," & TextBox2.Text & "," & DateTimePicker1.Value.ToShortDateString & " " & TextBox5.Text & ":00" & "," & TextBox4.Text & vbCrLf) End If Next End Sub