And for your other problem:
if (textBox1.Text is equal to what you want)
{
// Move on
}
else
{
// Dont
}
Just replace that with your actual code. If you are holding a password however that is very insecure
To make it invisible use this code:
this.Hide();
BUT if you are hiding your main form, then you will have to use Application.Exit(); when you want to shut down the application. Otherwise it will still run and cause problems. If it's not the main form of your application (by that I mean Form1), then use this.Close(); to just simply get rid of the form.
Hope this helps
God you are fond of python ain't ya, mentioned all the time lol. Treat C# like a completely different language, don't try to make comparisons as that just leads to trouble:
StreamReader reader = new StreamReader("MyFile.dat");
string strAllFile = reader.ReadToEnd().Replace("\r\n", "\n").Replace("\n\r", "\n");
string[] arrLines = strAllFile.Split(new char[] { '\n' });
textBox1.Text = arrLines[0];
textBox2.Text = arrLines[2];
That is reading line one from the .dat file and putting it into textbox1, and then reading line 3 and putting that in textbox2 using array.
StreamWriter writer = new StreamWriter("MyFile.dat");
writer.WriteLine("Hello");
writer.WriteLine("World");
That is writing hello and world to two lines in a .dat file.