Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Premium_Manager
- {
- public partial class Form4 : Form
- {
- public string username, password;
- public Form4()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- this.Hide();
- Form5 f5 = new Form5();
- f5.Show();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- var sr = new System.IO.StreamReader("C:\\" + textBox1.Text + "\\login.pmid");
- username = sr.ReadLine();
- password = sr.ReadLine();
- sr.Close();
- if (username == textBox1.Text && password == textBox2.Text)
- {
- MessageBox.Show("Your are now successfully logged in!", "Login Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
- this.Hide();
- Form1 f1 = new Form1();
- f1.ShowDialog();
- }
- else
- {
- MessageBox.Show("Username or password is wrong!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- catch (System.IO.DirectoryNotFoundException)
- {
- MessageBox.Show("The user doesn't exist", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void Form4_Load(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement