The problem is that you are not at all writing the colons, or adding a new line to the data when you write it to the file. Try this,
string data = string.Format("{0} : {1}\n{2} : {3}",
Namelabel.Text,
Nametextbox.Text,
passlabel.Text,
Passtextbox.Text
);
txt.Write(data);
What you were missing was that you were simply writing everything without a format being followed. In your template, you are using colons and a new line. In cases where you might want to use a template, I would recommend using a
String.Format()
[
^] method to build the data sample to be saved.