Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Xml;
- using System.Windows.Forms;
- namespace Loginfinal
- {
- public partial class Form1 : MaterialSkin.Controls.MaterialForm
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void LoadAccounts(bool RedactPasswords)
- {
- AccountList.Items.Clear();
- XmlDocument XMLAccounts = new XmlDocument();
- string Accounts = RequestManager.RequestAccounts(Identity.ID);
- try
- {
- XMLAccounts.LoadXml(Accounts);
- foreach (XmlNode Account in XMLAccounts.SelectNodes("Accounts/Account"))
- {
- string UID = Account.SelectSingleNode("id").InnerText;
- string Username = Account.SelectSingleNode("username").InnerText;
- string Password = Account.SelectSingleNode("password").InnerText;
- string URL = Account.SelectSingleNode("url").InnerText;
- string[] AccountToAdd = { UID, Username, Password, URL };
- ListViewItem AccountListItem = new ListViewItem(AccountToAdd);
- AccountList.Items.Add(AccountListItem);
- }
- AccountList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- }
- catch (Exception e)
- {
- MessageBox.Show(e.ToString());
- }
- if (RedactPasswords)
- PasswordRedaction();
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- PasswordRedaction();
- }
- private void PasswordRedaction()
- {
- if (PasswordHideCheckBox.Checked)
- {
- foreach (ListViewItem item in AccountList.Items)
- {
- int AsteriskCount = item.SubItems[2].Text.Length;
- string Asterisk = new string('*', AsteriskCount);
- if (AsteriskCount < 12)
- AsteriskCount += 10;
- item.SubItems[2].Text = Asterisk;
- }
- }
- else
- {
- AccountList.Items.Clear();
- LoadAccounts(false);
- }
- AccountList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- }
- private void AccountList_DoubleClick(object sender, EventArgs e)
- {
- if (PasswordHideCheckBox.Checked)
- LoadAccounts(false);
- string Username = AccountList.SelectedItems[0].SubItems[1].Text;
- string Password = AccountList.SelectedItems[0].SubItems[2].Text;
- if (PasswordHideCheckBox.Checked)
- LoadAccounts(true);
- if (AccountList.SelectedItems.Count > 0)
- RequestManager.Login(Username, Password);
- }
- private void CheckINISettingsSet()
- {
- Ini INISettings = new Ini();
- string SteamPath = INISettings.Read("SteamLocation");
- if (string.IsNullOrEmpty(SteamPath))
- {
- OpenFileDialog SetSteamPath = new OpenFileDialog();
- SetSteamPath.Filter = "Applications (*.exe)|*.exe";
- SetSteamPath.ShowDialog();
- INISettings.Write("SteamLocation", SetSteamPath.FileName);
- MessageBox.Show("Steam path has been saved!", "Settings Saved!", MessageBoxButtons.OK, MessageBoxIcon.Information);
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- CheckINISettingsSet();
- StatusStripAuthString.Text = string.Format("Auth String: {0}", Identity.HWID());
- LoadAccounts(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement