namespace Devoid { using Devoid.Properties; using Devoid.Sessions; using System; using System.ComponentModel; using System.Drawing; using System.IO; using System.Threading; using System.Windows.Forms; public class frmUpdateAccounts : Form { private GroupBox boxDetails; private GroupBox boxLog; private Button cmdAddTag; private Button cmdFindList; private Button cmdUpdate; private IContainer components = null; private OpenFileDialog fileBrowser; private Label label1; private Label label2; private Label lblFigure; private Label lblGender; private Label lblHeader; private Label lblMotto; private ListBox lstTags; private Thread mWorker; private RadioButton rdoGender_Female; private RadioButton rdoGender_Male; private TextBox txtFigure; private TextBox txtListLocation; private TextBox txtLog; private TextBox txtMotto; private TextBox txtTag; public frmUpdateAccounts() { this.InitializeComponent(); } private void cmdAddTag_Click(object sender, EventArgs e) { this.txtTag.Text = this.txtTag.Text.ToLower(); if (!((this.txtTag.Text.Length <= 3) || this.lstTags.Items.Contains(this.txtTag.Text))) { this.lstTags.Items.Add(this.txtTag.Text); } } private void cmdFindList_Click(object sender, EventArgs e) { if (this.fileBrowser.ShowDialog() == DialogResult.OK) { string fileName = this.fileBrowser.FileName; if (File.Exists(fileName)) { this.txtListLocation.Text = fileName; } else { this.txtListLocation.Text = "???"; } } } private void cmdUpdate_Click(object sender, EventArgs e) { if (this.mWorker == null) { if (File.Exists(this.txtListLocation.Text)) { this.cmdUpdate.Enabled = false; this.cmdUpdate.Text = "Stop updating"; this.boxDetails.Enabled = false; this.mWorker = new Thread(new ThreadStart(this.updateAccounts)); this.mWorker.Start(); } } else { try { this.mWorker.Abort(); } catch { } this.mWorker = null; this.cmdUpdate.Enabled = true; this.cmdUpdate.Text = "Start updating"; this.boxDetails.Enabled = true; } } protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.lblHeader = new Label(); this.boxDetails = new GroupBox(); this.rdoGender_Male = new RadioButton(); this.lblGender = new Label(); this.lblFigure = new Label(); this.txtFigure = new TextBox(); this.rdoGender_Female = new RadioButton(); this.lblMotto = new Label(); this.txtMotto = new TextBox(); this.lstTags = new ListBox(); this.label1 = new Label(); this.cmdAddTag = new Button(); this.txtTag = new TextBox(); this.cmdUpdate = new Button(); this.boxLog = new GroupBox(); this.txtLog = new TextBox(); this.label2 = new Label(); this.txtListLocation = new TextBox(); this.cmdFindList = new Button(); this.fileBrowser = new OpenFileDialog(); this.boxDetails.SuspendLayout(); this.boxLog.SuspendLayout(); base.SuspendLayout(); this.lblHeader.Font = new Font("Microsoft Sans Serif", 21.75f, FontStyle.Bold, GraphicsUnit.Point, 0); this.lblHeader.Location = new Point(6, 0x10); this.lblHeader.Name = "lblHeader"; this.lblHeader.Size = new Size(0x142, 0x27); this.lblHeader.TabIndex = 5; this.lblHeader.Text = "Update accounts"; this.lblHeader.TextAlign = ContentAlignment.MiddleCenter; this.boxDetails.Controls.Add(this.cmdFindList); this.boxDetails.Controls.Add(this.txtListLocation); this.boxDetails.Controls.Add(this.label2); this.boxDetails.Controls.Add(this.txtTag); this.boxDetails.Controls.Add(this.cmdAddTag); this.boxDetails.Controls.Add(this.label1); this.boxDetails.Controls.Add(this.lstTags); this.boxDetails.Controls.Add(this.lblMotto); this.boxDetails.Controls.Add(this.txtMotto); this.boxDetails.Controls.Add(this.rdoGender_Female); this.boxDetails.Controls.Add(this.rdoGender_Male); this.boxDetails.Controls.Add(this.lblGender); this.boxDetails.Controls.Add(this.lblFigure); this.boxDetails.Controls.Add(this.txtFigure); this.boxDetails.Location = new Point(3, 0x3a); this.boxDetails.Name = "boxDetails"; this.boxDetails.Size = new Size(0x13d, 0x14f); this.boxDetails.TabIndex = 4; this.boxDetails.TabStop = false; this.boxDetails.Text = "Properties"; this.rdoGender_Male.AutoSize = true; this.rdoGender_Male.Checked = true; this.rdoGender_Male.Location = new Point(5, 0x8b); this.rdoGender_Male.Name = "rdoGender_Male"; this.rdoGender_Male.Size = new Size(0x30, 0x11); this.rdoGender_Male.TabIndex = 10; this.rdoGender_Male.TabStop = true; this.rdoGender_Male.Text = "Male"; this.rdoGender_Male.UseVisualStyleBackColor = true; this.lblGender.AutoSize = true; this.lblGender.Location = new Point(2, 0x7b); this.lblGender.Name = "lblGender"; this.lblGender.Size = new Size(0x2a, 13); this.lblGender.TabIndex = 9; this.lblGender.Text = "Gender"; this.lblFigure.AutoSize = true; this.lblFigure.Location = new Point(2, 0x47); this.lblFigure.Name = "lblFigure"; this.lblFigure.Size = new Size(0x24, 13); this.lblFigure.TabIndex = 8; this.lblFigure.Text = "Figure"; this.txtFigure.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtFigure.Location = new Point(3, 0x57); this.txtFigure.Name = "txtFigure"; this.txtFigure.Size = new Size(0x131, 20); this.txtFigure.TabIndex = 7; this.txtFigure.Text = "hr-891-40.hd-190-22.ch-887-64.lg-280-63.sh-300-64.ha-1011-64.fa-1207-.ca-1819-.wa-2002-"; this.rdoGender_Female.AutoSize = true; this.rdoGender_Female.Location = new Point(0x3b, 0x8b); this.rdoGender_Female.Name = "rdoGender_Female"; this.rdoGender_Female.Size = new Size(0x3b, 0x11); this.rdoGender_Female.TabIndex = 11; this.rdoGender_Female.Text = "Female"; this.rdoGender_Female.UseVisualStyleBackColor = true; this.lblMotto.AutoSize = true; this.lblMotto.Location = new Point(4, 0x13); this.lblMotto.Name = "lblMotto"; this.lblMotto.Size = new Size(0x22, 13); this.lblMotto.TabIndex = 13; this.lblMotto.Text = "Motto"; this.txtMotto.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtMotto.Location = new Point(3, 0x23); this.txtMotto.Name = "txtMotto"; this.txtMotto.Size = new Size(0x131, 20); this.txtMotto.TabIndex = 12; this.txtMotto.Text = "Devoid: Nillus"; this.lstTags.FormattingEnabled = true; this.lstTags.Location = new Point(6, 0xc0); this.lstTags.Name = "lstTags"; this.lstTags.Size = new Size(0x131, 0x38); this.lstTags.TabIndex = 15; this.label1.AutoSize = true; this.label1.Location = new Point(2, 0xb0); this.label1.Name = "label1"; this.label1.Size = new Size(0x45, 13); this.label1.TabIndex = 0x10; this.label1.Text = "Tags to ADD"; this.cmdAddTag.FlatStyle = FlatStyle.Flat; this.cmdAddTag.Image = Resources.add; this.cmdAddTag.ImageAlign = ContentAlignment.MiddleLeft; this.cmdAddTag.Location = new Point(0x3b, 0xfe); this.cmdAddTag.Name = "cmdAddTag"; this.cmdAddTag.Size = new Size(0xfc, 0x1d); this.cmdAddTag.TabIndex = 0x11; this.cmdAddTag.Text = "Add tag"; this.cmdAddTag.UseVisualStyleBackColor = true; this.cmdAddTag.Click += new EventHandler(this.cmdAddTag_Click); this.txtTag.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtTag.Location = new Point(6, 0xfe); this.txtTag.Name = "txtTag"; this.txtTag.Size = new Size(0x2f, 20); this.txtTag.TabIndex = 0x12; this.txtTag.Text = "nillus"; this.cmdUpdate.FlatStyle = FlatStyle.Flat; this.cmdUpdate.Image = Resources.asterisk_orange; this.cmdUpdate.ImageAlign = ContentAlignment.MiddleLeft; this.cmdUpdate.Location = new Point(3, 0x18f); this.cmdUpdate.Name = "cmdUpdate"; this.cmdUpdate.Size = new Size(0x13d, 30); this.cmdUpdate.TabIndex = 15; this.cmdUpdate.Text = "Start updating"; this.cmdUpdate.UseVisualStyleBackColor = true; this.cmdUpdate.Click += new EventHandler(this.cmdUpdate_Click); this.boxLog.Controls.Add(this.txtLog); this.boxLog.Location = new Point(0x146, 0x3a); this.boxLog.Name = "boxLog"; this.boxLog.Size = new Size(0xc5, 0x173); this.boxLog.TabIndex = 0x10; this.boxLog.TabStop = false; this.boxLog.Text = "Log"; this.txtLog.BorderStyle = BorderStyle.FixedSingle; this.txtLog.Dock = DockStyle.Fill; this.txtLog.Location = new Point(3, 0x10); this.txtLog.Multiline = true; this.txtLog.Name = "txtLog"; this.txtLog.ScrollBars = ScrollBars.Vertical; this.txtLog.Size = new Size(0xbf, 0x160); this.txtLog.TabIndex = 0; this.label2.AutoSize = true; this.label2.Location = new Point(3, 0x125); this.label2.Name = "label2"; this.label2.Size = new Size(0x55, 13); this.label2.TabIndex = 0x13; this.label2.Text = "Account list (.txt)"; this.txtListLocation.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtListLocation.Location = new Point(5, 0x135); this.txtListLocation.Name = "txtListLocation"; this.txtListLocation.Size = new Size(270, 20); this.txtListLocation.TabIndex = 20; this.txtListLocation.Text = "???"; this.cmdFindList.FlatStyle = FlatStyle.Flat; this.cmdFindList.Image = Resources.book_open; this.cmdFindList.ImageAlign = ContentAlignment.MiddleLeft; this.cmdFindList.Location = new Point(0x117, 0x130); this.cmdFindList.Name = "cmdFindList"; this.cmdFindList.Size = new Size(0x20, 0x1d); this.cmdFindList.TabIndex = 0x15; this.cmdFindList.UseVisualStyleBackColor = true; this.cmdFindList.Click += new EventHandler(this.cmdFindList_Click); this.fileBrowser.FileName = "accounts"; this.fileBrowser.Filter = "Accountlists|*.txt"; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.ClientSize = new Size(0x210, 0x1b9); base.Controls.Add(this.boxLog); base.Controls.Add(this.cmdUpdate); base.Controls.Add(this.lblHeader); base.Controls.Add(this.boxDetails); base.Name = "frmUpdateAccounts"; this.Text = "Devoid : update accounts"; this.boxDetails.ResumeLayout(false); this.boxDetails.PerformLayout(); this.boxLog.ResumeLayout(false); this.boxLog.PerformLayout(); base.ResumeLayout(false); } private void updateAccounts() { string text = this.txtMotto.Text; string figure = this.txtFigure.Text; string gender = "M"; if (this.rdoGender_Female.Checked) { gender = "F"; } string[] strArray = new string[this.lstTags.Items.Count]; int index = 0; while (index < strArray.Length) { strArray[index] = this.lstTags.Items[index].ToString(); index++; } bool flag = text.Length > 0; bool flag2 = figure.Length > 0; bool flag3 = strArray.Length > 0; if (!((flag || flag2) || flag3)) { this.cmdUpdate_Click(null, null); } else { string str4; StreamReader reader = new StreamReader(this.txtListLocation.Text); while ((str4 = reader.ReadLine()) != null) { string[] strArray2 = str4.Split(new char[] { Convert.ToChar(9) }); if (strArray2.Length == 2) { userSession pSession = Engine.Site.LogUserIn(strArray2[0], strArray2[1]); if (pSession != null) { if (flag) { Engine.Site.updateUserMotto(pSession, text); } if (flag2) { Engine.Site.updateUserAppearance(pSession, figure, gender); } if (flag3) { for (index = 0; index < strArray.Length; index++) { Engine.Site.addUserTag(pSession, strArray[index]); } } } } str4 = reader.ReadLine(); } reader.Close(); reader.Dispose(); } } } }