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.Drawing;
- using System.Resources;
- using System.Windows.Forms;
- namespace SteamCrack
- {
- public class Search : Form
- {
- public List<string> added = new List<string>();
- private int mouseX = 0;
- private int mouseY = 0;
- private bool mouseDown;
- private IContainer components = null;
- private WebBrowser webBrowser1;
- private Panel panel1;
- private Label label3;
- private Label label1;
- private TextBox textBox2;
- private TextBox textBox1;
- private Label label4;
- private Label label2;
- private Button button2;
- private Button button1;
- private Panel panel2;
- private LinkLabel linkLabel4;
- public Search()
- {
- this.InitializeComponent();
- this.webBrowser1.Navigate("http://store.steampowered.com/");
- this.added.Clear();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.textBox1.Text != "")
- {
- this.label2.ForeColor = Color.FromArgb(91, 193, 254);
- }
- else
- {
- this.label2.ForeColor = Color.Red;
- }
- if (this.textBox2.Text != "")
- {
- this.label4.ForeColor = Color.FromArgb(91, 193, 254);
- }
- else
- {
- this.label4.ForeColor = Color.Red;
- }
- if ((this.textBox1.Text == "" ? false : this.textBox2.Text != ""))
- {
- string str = string.Concat(this.textBox1.Text, ",", this.textBox2.Text);
- bool flag = false;
- foreach (string game in (new Form1()).games)
- {
- if (game.Split(new char[] { ',' })[1] == this.textBox2.Text)
- {
- flag = true;
- }
- }
- if (!flag)
- {
- foreach (string str1 in this.added)
- {
- if (str1.Split(new char[] { ',' })[1] == this.textBox2.Text)
- {
- flag = true;
- }
- }
- if (flag)
- {
- MessageBox.Show("Already Added");
- }
- else
- {
- this.added.Add(str);
- MessageBox.Show("Added!");
- }
- this.textBox1.Clear();
- this.textBox2.Clear();
- }
- else
- {
- MessageBox.Show("Already Added");
- }
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- base.Close();
- }
- protected override void Dispose(bool disposing)
- {
- if ((!disposing ? false : this.components != null))
- {
- this.components.Dispose();
- }
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Search));
- this.webBrowser1 = new WebBrowser();
- this.panel1 = new Panel();
- this.button2 = new Button();
- this.button1 = new Button();
- this.textBox2 = new TextBox();
- this.textBox1 = new TextBox();
- this.label4 = new Label();
- this.label2 = new Label();
- this.label3 = new Label();
- this.label1 = new Label();
- this.panel2 = new Panel();
- this.linkLabel4 = new LinkLabel();
- this.panel1.SuspendLayout();
- base.SuspendLayout();
- this.webBrowser1.IsWebBrowserContextMenuEnabled = false;
- this.webBrowser1.Location = new Point(17, 50);
- this.webBrowser1.MinimumSize = new Size(20, 20);
- this.webBrowser1.Name = "webBrowser1";
- this.webBrowser1.ScriptErrorsSuppressed = true;
- this.webBrowser1.Size = new Size(994, 544);
- this.webBrowser1.TabIndex = 0;
- this.webBrowser1.Url = new Uri("", UriKind.Relative);
- this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);
- this.panel1.BackColor = Color.FromArgb(27, 40, 56);
- this.panel1.BorderStyle = BorderStyle.FixedSingle;
- this.panel1.Controls.Add(this.linkLabel4);
- this.panel1.Controls.Add(this.button2);
- this.panel1.Controls.Add(this.button1);
- this.panel1.Controls.Add(this.textBox2);
- this.panel1.Controls.Add(this.textBox1);
- this.panel1.Controls.Add(this.label4);
- this.panel1.Controls.Add(this.label2);
- this.panel1.Location = new Point(17, 595);
- this.panel1.Name = "panel1";
- this.panel1.Size = new Size(994, 104);
- this.panel1.TabIndex = 1;
- this.button2.Location = new Point(681, 27);
- this.button2.Name = "button2";
- this.button2.Size = new Size(88, 35);
- this.button2.TabIndex = 5;
- this.button2.Text = "Done";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new EventHandler(this.button2_Click);
- this.button1.Location = new Point(572, 26);
- this.button1.Name = "button1";
- this.button1.Size = new Size(88, 36);
- this.button1.TabIndex = 4;
- this.button1.Text = "Add";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new EventHandler(this.button1_Click);
- this.textBox2.BackColor = Color.FromArgb(21, 31, 44);
- this.textBox2.ForeColor = Color.White;
- this.textBox2.Location = new Point(424, 42);
- this.textBox2.Name = "textBox2";
- this.textBox2.ReadOnly = true;
- this.textBox2.Size = new Size(100, 20);
- this.textBox2.TabIndex = 3;
- this.textBox1.BackColor = Color.FromArgb(21, 31, 44);
- this.textBox1.ForeColor = Color.White;
- this.textBox1.Location = new Point(40, 42);
- this.textBox1.Name = "textBox1";
- this.textBox1.Size = new Size(354, 20);
- this.textBox1.TabIndex = 2;
- this.label4.AutoSize = true;
- this.label4.BackColor = Color.Transparent;
- this.label4.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
- this.label4.ForeColor = Color.FromArgb(91, 143, 195);
- this.label4.Location = new Point(421, 26);
- this.label4.Name = "label4";
- this.label4.Size = new Size(60, 13);
- this.label4.TabIndex = 0;
- this.label4.Text = "Game ID:";
- this.label2.AutoSize = true;
- this.label2.BackColor = Color.Transparent;
- this.label2.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
- this.label2.ForeColor = Color.FromArgb(91, 143, 195);
- this.label2.Location = new Point(37, 26);
- this.label2.Name = "label2";
- this.label2.Size = new Size(79, 13);
- this.label2.TabIndex = 0;
- this.label2.Text = "Game Name:";
- this.label3.AutoSize = true;
- this.label3.BackColor = Color.Transparent;
- this.label3.Font = new Font("Calibri", 12f, FontStyle.Bold, GraphicsUnit.Point, 0);
- this.label3.ForeColor = Color.LightGray;
- this.label3.Location = new Point(1002, 9);
- this.label3.Name = "label3";
- this.label3.Size = new Size(18, 19);
- this.label3.TabIndex = 11;
- this.label3.Text = "X";
- this.label3.Click += new EventHandler(this.label3_Click);
- this.label3.MouseLeave += new EventHandler(this.label3_MouseLeave);
- this.label3.MouseHover += new EventHandler(this.label3_MouseHover);
- this.label1.AutoSize = true;
- this.label1.BackColor = Color.Transparent;
- this.label1.ForeColor = Color.White;
- this.label1.Location = new Point(17, 31);
- this.label1.Name = "label1";
- this.label1.Size = new Size(35, 13);
- this.label1.TabIndex = 12;
- this.label1.Text = "label1";
- this.panel2.BackColor = Color.Transparent;
- this.panel2.Location = new Point(1, 1);
- this.panel2.Name = "panel2";
- this.panel2.Size = new Size(1033, 43);
- this.panel2.TabIndex = 13;
- this.panel2.MouseDown += new MouseEventHandler(this.panel2_MouseDown);
- this.panel2.MouseMove += new MouseEventHandler(this.panel2_MouseMove);
- this.panel2.MouseUp += new MouseEventHandler(this.panel2_MouseUp);
- this.linkLabel4.ActiveLinkColor = Color.Gray;
- this.linkLabel4.AutoSize = true;
- this.linkLabel4.BackColor = Color.Transparent;
- this.linkLabel4.LinkBehavior = LinkBehavior.HoverUnderline;
- this.linkLabel4.LinkColor = Color.White;
- this.linkLabel4.Location = new Point(789, 38);
- this.linkLabel4.Name = "linkLabel4";
- this.linkLabel4.Size = new Size(19, 13);
- this.linkLabel4.TabIndex = 19;
- this.linkLabel4.TabStop = true;
- this.linkLabel4.Text = "[?]";
- this.linkLabel4.VisitedLinkColor = Color.White;
- this.linkLabel4.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
- base.AutoScaleDimensions = new SizeF(6f, 13f);
- base.AutoScaleMode = AutoScaleMode.Font;
- this.BackgroundImage = (Image)componentResourceManager.GetObject("$this.BackgroundImage");
- this.BackgroundImageLayout = ImageLayout.Stretch;
- base.ClientSize = new Size(1032, 711);
- base.Controls.Add(this.label1);
- base.Controls.Add(this.label3);
- base.Controls.Add(this.webBrowser1);
- base.Controls.Add(this.panel1);
- base.Controls.Add(this.panel2);
- base.FormBorderStyle = FormBorderStyle.None;
- base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
- base.Name = "Search";
- base.StartPosition = FormStartPosition.CenterScreen;
- this.Text = "Search";
- this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
- base.ResumeLayout(false);
- base.PerformLayout();
- }
- private void label3_Click(object sender, EventArgs e)
- {
- base.Close();
- }
- private void label3_MouseHover(object sender, EventArgs e)
- {
- this.label3.ForeColor = Color.FromArgb(254, 254, 254);
- }
- private void label3_MouseLeave(object sender, EventArgs e)
- {
- this.label3.ForeColor = Color.FromArgb(169, 170, 174);
- }
- private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- (new Form1()).help("search");
- }
- private void panel2_MouseDown(object sender, MouseEventArgs e)
- {
- this.mouseDown = true;
- }
- private void panel2_MouseMove(object sender, MouseEventArgs e)
- {
- if (this.mouseDown)
- {
- Point mousePosition = Control.MousePosition;
- this.mouseX = mousePosition.X - 515;
- mousePosition = Control.MousePosition;
- this.mouseY = mousePosition.Y - 20;
- base.SetDesktopLocation(this.mouseX, this.mouseY);
- }
- }
- private void panel2_MouseUp(object sender, MouseEventArgs e)
- {
- this.mouseDown = false;
- }
- private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
- {
- this.label1.Text = this.webBrowser1.Url.ToString();
- string[] strArrays = this.webBrowser1.Url.ToString().Split(new char[] { '/' });
- try
- {
- if (strArrays[3] == "app")
- {
- this.textBox2.Text = strArrays[4];
- }
- }
- catch
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement