For the txt file:
Dim file_name As String = DataFile()
Dim stream_reader As New IO.StreamReader(file_name)
Dim line As String
' Read the file one line at a time.
line = stream_reader.ReadLine()
Do While Not (line Is Nothing)
' Trim and make sure the line isn't blank.
line = line.Trim()
If line.Length %26gt; 0 Then _
lstAnimals.Items.Add(line)
' Get the next line.
line = stream_reader.ReadLine()
Loop
lstAnimals.SelectedIndex = 0
stream_reader.Close()
Catch exc As Exception
' Report all errors.
MsgBox(exc.Message, MsgBoxStyle.Exclamation, ';Read '; %26amp; _
';Error';)
End Try
For the DateTimePicker I had luck with using the value.date property. I would also use now.date simply because it's unlikely you are going to choose the exact millisecond that you are looking for:
If DateTimePicker1.Value.Date = Now.Date Then
MsgBox(';HEY!!!!!!!';)
Else
End If
No comments:
Post a Comment