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.Windows.Forms;
- using System.IO;
- using System.Net;
- using System.Diagnostics;
- namespace Form1
- {
- public partial class Form1 : Form
- {
- private TextBox txtPassword;
- private TextBox txtUsername;
- public string Username { get; set; }
- public string Password { get; set; }
- public Form1(string user, string pass)
- {
- this.InitializeComponent();
- }
- private void PlJcEasmpb(object sender, EventArgs e)
- {
- this.Username = this.txtUsername.Text;
- this.Password = this.txtPassword.Text;
- this.Close();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click(object sender, EventArgs e)
- {
- var client = new WebClient();
- StreamReader reader = new StreamReader(new WebClient().OpenRead("http://website.com/login.php?user=" + this.Username + "&pass=" + this.Password));
- string status = reader.ReadToEnd();
- if (status == "ok")
- {
- // đăng nhập thành công
- }
- else
- {
- // sai tài khoản hoặc mật khẩu
- }
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void textBox1_TextChanged(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement