I'm using the code below to open a file from the target directory and display it to a multi line textbox, I need help in getting stream reader to open the file so it can be appended... curser at the end of the last entry in the file ready for a new entry to be added instead of it being in the first postion on first line. Once the file has a new entry added to it then I need extra code to save the file like the File/Save in Notepad, I also need more code for a File Save As method to save a backup copy of the file to a startup path directory Application.StartupPath() & "\Backup Number Files\"
What's below is all I have so far... working code for the rest of my description above would be greatly appreciated. I'm using .NET 2005 and it's basic File/open File/save File/save as but i'm kinda new to .NET so I have a learning deficiency so far.
I'd also like to know if there's a way to get the title of the form to change to the name of the file I open.... also like Microsoft's Notepad does. Points go to the most help on all the above problems/questions.
Public Class Analyzer
Dim FileName As String = Application.StartupPath() & "\Number Files\"
Dim sr As StreamReader
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
Dim supportPath As String = Application.StartupPath() & "\Number Files\"
OpenFileDialog1.Title = "Please select a game file to open"
OpenFileDialog1.InitialDirectory = supportPath
OpenFileDialog1.FileName = ""
.Filter = "Game Files (*.Game)|*.Game|" & "None|"
If .ShowDialog() = Windows.Forms.DialogResult.OK Then
FileName = .FileName
sr = New StreamReader(.OpenFile)
TextBox1.Text = sr.ReadToEnd()
Catch es As Exception
If Not (sr Is Nothing) Then