Because you are making a mistake as follows: When you close the first stream therefore without reopening it you can't define UserName1 inside the second stream because its closed. Your approach to check username, password, etc. seems not appripriate. I suggest you to reorganize your code. :wtf:
What a curious mind needs to discover knowledge is noting else than a pin-hole.