View difference between Paste ID: peNwzJub and S2QpUKug
SHOW: | | - or go back to the newest paste.
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9
using System.Windows.Forms;
10
using System.IO;
11
12
namespace LoginForm
13
{
14
    public partial class Form1 : Form
15
    {
16
        public Form1()
17
        {
18
            InitializeComponent();
19
        }
20
21
        private void SubmitBTN_Click(object sender, EventArgs e)
22
        {
23-
			string username = File.ReadAllLines("username.txt");
23+
			string username = File.ReadAllText("username.txt");
24-
            string pass = File.ReadAllLines("password.txt");
24+
            string pass = File.ReadAllText("password.txt");
25
26
            if ((UsernameBox.Text == username) && (Passwordbox.Text == pass))
27
                MessageBox.Show("Du har loggat in!");
28
            else
29
                MessageBox.Show("Fel lösernod/användarnamn");
30
        }
31
    }
32
}