It looks like you're new here. If you want to get involved, click one of these buttons!
Imports System.IO
Imports System
Public Class Form1
Dim file As Stream
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Timer1.Stop()
Me.Close()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim sReader As StreamReader
OpenFileDialog1.CheckFileExists = True
OpenFileDialog1.CheckPathExists = True
OpenFileDialog1.DefaultExt = \"txt\"
OpenFileDialog1.FileName = \"\"
OpenFileDialog1.Filter = \"Text Files (*.txt)|*.txt|All Files (*.*)|*.*\"
OpenFileDialog1.Multiselect = False
If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
sReader = New StreamReader(OpenFileDialog1.FileName, True)
'TextBox1.Text = oReader.ReadToEnd
Dim section As Integer
section = 0
For Each line As String In sReader.ReadToEnd().Split(vbNewLine)
If line.Trim() = \"------------ ------------\" Then
section = section + 1
Else
If section = 0 Then
TextBox1.AppendText(line)
ElseIf section = 1 Then
TextBox2.AppendText(line)
ElseIf section = 2 Then
TextBox3.AppendText(line)
ElseIf section = 3 Then
TextBox4.AppendText(line)
End If
End If
Next
End If
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
TextBox1.Text = \" \"
TextBox2.Text = \" \"
TextBox3.Text = \" \"
TextBox4.Text = \" \"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
SaveFileDialog1.DefaultExt = \"txt\"
SaveFileDialog1.FileName = \"\"
SaveFileDialog1.Filter = \"Text Files (*.txt)|*.txt|All Files (*.*)|*.*\"
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim sWriter As StreamWriter
sWriter = New StreamWriter(SaveFileDialog1.FileName, True)
sWriter.WriteLine(TextBox1.Text)
sWriter.WriteLine(\"------------ ------------\")
sWriter.WriteLine(TextBox2.Text)
sWriter.WriteLine(\"------------ ------------\")
sWriter.WriteLine(TextBox3.Text)
sWriter.WriteLine(\"------------ ------------\")
sWriter.WriteLine(TextBox4.Text)
sWriter.WriteLine(\"------------ ------------\")
sWriter.WriteLine(\"Last Saved On: \" + My.Computer.Clock.LocalTime)
sWriter.Close()
End If
End Sub
Private Sub ps_helper_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label6.Text = My.Computer.Clock.LocalTime.ToString
Timer1.Interval = 1000
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Label6.Text = My.Computer.Clock.LocalTime.ToString
End Sub
End Class