Advertisement
Guest User

Untitled

a guest
Feb 18th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  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.Windows.Forms;
  9. using System.IO;
  10. using System.Net;
  11. using System.Diagnostics;
  12.  
  13. namespace Form1
  14. {
  15. public partial class Form1 : Form
  16. {
  17. private TextBox txtPassword;
  18. private TextBox txtUsername;
  19. public string Username { get; set; }
  20.  
  21. public string Password { get; set; }
  22. public Form1(string user, string pass)
  23. {
  24. this.InitializeComponent();
  25.  
  26. }
  27. private void PlJcEasmpb(object sender, EventArgs e)
  28. {
  29. this.Username = this.txtUsername.Text;
  30. this.Password = this.txtPassword.Text;
  31. this.Close();
  32. }
  33. private void Form1_Load(object sender, EventArgs e)
  34. {
  35.  
  36. }
  37.  
  38. private void button1_Click(object sender, EventArgs e)
  39. {
  40. var client = new WebClient();
  41. StreamReader reader = new StreamReader(new WebClient().OpenRead("http://website.com/login.php?user=" + this.Username + "&pass=" + this.Password));
  42. string status = reader.ReadToEnd();
  43. if (status == "ok")
  44. {
  45. // đăng nhập thành công
  46. }
  47. else
  48. {
  49. // sai tài khoản hoặc mật khẩu
  50. }
  51. }
  52.  
  53. private void textBox2_TextChanged(object sender, EventArgs e)
  54. {
  55.  
  56. }
  57.  
  58. private void textBox1_TextChanged(object sender, EventArgs e)
  59. {
  60.  
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement