Advertisement
Guest User

Search

a guest
Apr 27th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Resources;
  6. using System.Windows.Forms;
  7.  
  8. namespace SteamCrack
  9. {
  10.     public class Search : Form
  11.     {
  12.         public List<string> added = new List<string>();
  13.  
  14.         private int mouseX = 0;
  15.  
  16.         private int mouseY = 0;
  17.  
  18.         private bool mouseDown;
  19.  
  20.         private IContainer components = null;
  21.  
  22.         private WebBrowser webBrowser1;
  23.  
  24.         private Panel panel1;
  25.  
  26.         private Label label3;
  27.  
  28.         private Label label1;
  29.  
  30.         private TextBox textBox2;
  31.  
  32.         private TextBox textBox1;
  33.  
  34.         private Label label4;
  35.  
  36.         private Label label2;
  37.  
  38.         private Button button2;
  39.  
  40.         private Button button1;
  41.  
  42.         private Panel panel2;
  43.  
  44.         private LinkLabel linkLabel4;
  45.  
  46.         public Search()
  47.         {
  48.             this.InitializeComponent();
  49.             this.webBrowser1.Navigate("http://store.steampowered.com/");
  50.             this.added.Clear();
  51.         }
  52.  
  53.         private void button1_Click(object sender, EventArgs e)
  54.         {
  55.             if (this.textBox1.Text != "")
  56.             {
  57.                 this.label2.ForeColor = Color.FromArgb(91, 193, 254);
  58.             }
  59.             else
  60.             {
  61.                 this.label2.ForeColor = Color.Red;
  62.             }
  63.             if (this.textBox2.Text != "")
  64.             {
  65.                 this.label4.ForeColor = Color.FromArgb(91, 193, 254);
  66.             }
  67.             else
  68.             {
  69.                 this.label4.ForeColor = Color.Red;
  70.             }
  71.             if ((this.textBox1.Text == "" ? false : this.textBox2.Text != ""))
  72.             {
  73.                 string str = string.Concat(this.textBox1.Text, ",", this.textBox2.Text);
  74.                 bool flag = false;
  75.                 foreach (string game in (new Form1()).games)
  76.                 {
  77.                     if (game.Split(new char[] { ',' })[1] == this.textBox2.Text)
  78.                    {
  79.                         flag = true;
  80.                     }
  81.                 }
  82.                 if (!flag)
  83.                 {
  84.                     foreach (string str1 in this.added)
  85.                     {
  86.                         if (str1.Split(new char[] { ',' })[1] == this.textBox2.Text)
  87.                        {
  88.                             flag = true;
  89.                         }
  90.                     }
  91.                     if (flag)
  92.                     {
  93.                         MessageBox.Show("Already Added");
  94.                     }
  95.                     else
  96.                     {
  97.                         this.added.Add(str);
  98.                         MessageBox.Show("Added!");
  99.                     }
  100.                     this.textBox1.Clear();
  101.                     this.textBox2.Clear();
  102.                 }
  103.                 else
  104.                 {
  105.                     MessageBox.Show("Already Added");
  106.                 }
  107.             }
  108.         }
  109.  
  110.         private void button2_Click(object sender, EventArgs e)
  111.         {
  112.             base.Close();
  113.         }
  114.  
  115.         protected override void Dispose(bool disposing)
  116.         {
  117.             if ((!disposing ? false : this.components != null))
  118.             {
  119.                 this.components.Dispose();
  120.             }
  121.             base.Dispose(disposing);
  122.         }
  123.  
  124.         private void InitializeComponent()
  125.         {
  126.             ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(Search));
  127.             this.webBrowser1 = new WebBrowser();
  128.             this.panel1 = new Panel();
  129.             this.button2 = new Button();
  130.             this.button1 = new Button();
  131.             this.textBox2 = new TextBox();
  132.             this.textBox1 = new TextBox();
  133.             this.label4 = new Label();
  134.             this.label2 = new Label();
  135.             this.label3 = new Label();
  136.             this.label1 = new Label();
  137.             this.panel2 = new Panel();
  138.             this.linkLabel4 = new LinkLabel();
  139.             this.panel1.SuspendLayout();
  140.             base.SuspendLayout();
  141.             this.webBrowser1.IsWebBrowserContextMenuEnabled = false;
  142.             this.webBrowser1.Location = new Point(17, 50);
  143.             this.webBrowser1.MinimumSize = new Size(20, 20);
  144.             this.webBrowser1.Name = "webBrowser1";
  145.             this.webBrowser1.ScriptErrorsSuppressed = true;
  146.             this.webBrowser1.Size = new Size(994, 544);
  147.             this.webBrowser1.TabIndex = 0;
  148.             this.webBrowser1.Url = new Uri("", UriKind.Relative);
  149.             this.webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);
  150.             this.panel1.BackColor = Color.FromArgb(27, 40, 56);
  151.             this.panel1.BorderStyle = BorderStyle.FixedSingle;
  152.             this.panel1.Controls.Add(this.linkLabel4);
  153.             this.panel1.Controls.Add(this.button2);
  154.             this.panel1.Controls.Add(this.button1);
  155.             this.panel1.Controls.Add(this.textBox2);
  156.             this.panel1.Controls.Add(this.textBox1);
  157.             this.panel1.Controls.Add(this.label4);
  158.             this.panel1.Controls.Add(this.label2);
  159.             this.panel1.Location = new Point(17, 595);
  160.             this.panel1.Name = "panel1";
  161.             this.panel1.Size = new Size(994, 104);
  162.             this.panel1.TabIndex = 1;
  163.             this.button2.Location = new Point(681, 27);
  164.             this.button2.Name = "button2";
  165.             this.button2.Size = new Size(88, 35);
  166.             this.button2.TabIndex = 5;
  167.             this.button2.Text = "Done";
  168.             this.button2.UseVisualStyleBackColor = true;
  169.             this.button2.Click += new EventHandler(this.button2_Click);
  170.             this.button1.Location = new Point(572, 26);
  171.             this.button1.Name = "button1";
  172.             this.button1.Size = new Size(88, 36);
  173.             this.button1.TabIndex = 4;
  174.             this.button1.Text = "Add";
  175.             this.button1.UseVisualStyleBackColor = true;
  176.             this.button1.Click += new EventHandler(this.button1_Click);
  177.             this.textBox2.BackColor = Color.FromArgb(21, 31, 44);
  178.             this.textBox2.ForeColor = Color.White;
  179.             this.textBox2.Location = new Point(424, 42);
  180.             this.textBox2.Name = "textBox2";
  181.             this.textBox2.ReadOnly = true;
  182.             this.textBox2.Size = new Size(100, 20);
  183.             this.textBox2.TabIndex = 3;
  184.             this.textBox1.BackColor = Color.FromArgb(21, 31, 44);
  185.             this.textBox1.ForeColor = Color.White;
  186.             this.textBox1.Location = new Point(40, 42);
  187.             this.textBox1.Name = "textBox1";
  188.             this.textBox1.Size = new Size(354, 20);
  189.             this.textBox1.TabIndex = 2;
  190.             this.label4.AutoSize = true;
  191.             this.label4.BackColor = Color.Transparent;
  192.             this.label4.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  193.             this.label4.ForeColor = Color.FromArgb(91, 143, 195);
  194.             this.label4.Location = new Point(421, 26);
  195.             this.label4.Name = "label4";
  196.             this.label4.Size = new Size(60, 13);
  197.             this.label4.TabIndex = 0;
  198.             this.label4.Text = "Game ID:";
  199.             this.label2.AutoSize = true;
  200.             this.label2.BackColor = Color.Transparent;
  201.             this.label2.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
  202.             this.label2.ForeColor = Color.FromArgb(91, 143, 195);
  203.             this.label2.Location = new Point(37, 26);
  204.             this.label2.Name = "label2";
  205.             this.label2.Size = new Size(79, 13);
  206.             this.label2.TabIndex = 0;
  207.             this.label2.Text = "Game Name:";
  208.             this.label3.AutoSize = true;
  209.             this.label3.BackColor = Color.Transparent;
  210.             this.label3.Font = new Font("Calibri", 12f, FontStyle.Bold, GraphicsUnit.Point, 0);
  211.             this.label3.ForeColor = Color.LightGray;
  212.             this.label3.Location = new Point(1002, 9);
  213.             this.label3.Name = "label3";
  214.             this.label3.Size = new Size(18, 19);
  215.             this.label3.TabIndex = 11;
  216.             this.label3.Text = "X";
  217.             this.label3.Click += new EventHandler(this.label3_Click);
  218.             this.label3.MouseLeave += new EventHandler(this.label3_MouseLeave);
  219.             this.label3.MouseHover += new EventHandler(this.label3_MouseHover);
  220.             this.label1.AutoSize = true;
  221.             this.label1.BackColor = Color.Transparent;
  222.             this.label1.ForeColor = Color.White;
  223.             this.label1.Location = new Point(17, 31);
  224.             this.label1.Name = "label1";
  225.             this.label1.Size = new Size(35, 13);
  226.             this.label1.TabIndex = 12;
  227.             this.label1.Text = "label1";
  228.             this.panel2.BackColor = Color.Transparent;
  229.             this.panel2.Location = new Point(1, 1);
  230.             this.panel2.Name = "panel2";
  231.             this.panel2.Size = new Size(1033, 43);
  232.             this.panel2.TabIndex = 13;
  233.             this.panel2.MouseDown += new MouseEventHandler(this.panel2_MouseDown);
  234.             this.panel2.MouseMove += new MouseEventHandler(this.panel2_MouseMove);
  235.             this.panel2.MouseUp += new MouseEventHandler(this.panel2_MouseUp);
  236.             this.linkLabel4.ActiveLinkColor = Color.Gray;
  237.             this.linkLabel4.AutoSize = true;
  238.             this.linkLabel4.BackColor = Color.Transparent;
  239.             this.linkLabel4.LinkBehavior = LinkBehavior.HoverUnderline;
  240.             this.linkLabel4.LinkColor = Color.White;
  241.             this.linkLabel4.Location = new Point(789, 38);
  242.             this.linkLabel4.Name = "linkLabel4";
  243.             this.linkLabel4.Size = new Size(19, 13);
  244.             this.linkLabel4.TabIndex = 19;
  245.             this.linkLabel4.TabStop = true;
  246.             this.linkLabel4.Text = "[?]";
  247.             this.linkLabel4.VisitedLinkColor = Color.White;
  248.             this.linkLabel4.LinkClicked += new LinkLabelLinkClickedEventHandler(this.linkLabel4_LinkClicked);
  249.             base.AutoScaleDimensions = new SizeF(6f, 13f);
  250.             base.AutoScaleMode = AutoScaleMode.Font;
  251.             this.BackgroundImage = (Image)componentResourceManager.GetObject("$this.BackgroundImage");
  252.             this.BackgroundImageLayout = ImageLayout.Stretch;
  253.             base.ClientSize = new Size(1032, 711);
  254.             base.Controls.Add(this.label1);
  255.             base.Controls.Add(this.label3);
  256.             base.Controls.Add(this.webBrowser1);
  257.             base.Controls.Add(this.panel1);
  258.             base.Controls.Add(this.panel2);
  259.             base.FormBorderStyle = FormBorderStyle.None;
  260.             base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
  261.             base.Name = "Search";
  262.             base.StartPosition = FormStartPosition.CenterScreen;
  263.             this.Text = "Search";
  264.             this.panel1.ResumeLayout(false);
  265.             this.panel1.PerformLayout();
  266.             base.ResumeLayout(false);
  267.             base.PerformLayout();
  268.         }
  269.  
  270.         private void label3_Click(object sender, EventArgs e)
  271.         {
  272.             base.Close();
  273.         }
  274.  
  275.         private void label3_MouseHover(object sender, EventArgs e)
  276.         {
  277.             this.label3.ForeColor = Color.FromArgb(254, 254, 254);
  278.         }
  279.  
  280.         private void label3_MouseLeave(object sender, EventArgs e)
  281.         {
  282.             this.label3.ForeColor = Color.FromArgb(169, 170, 174);
  283.         }
  284.  
  285.         private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
  286.         {
  287.             (new Form1()).help("search");
  288.         }
  289.  
  290.         private void panel2_MouseDown(object sender, MouseEventArgs e)
  291.         {
  292.             this.mouseDown = true;
  293.         }
  294.  
  295.         private void panel2_MouseMove(object sender, MouseEventArgs e)
  296.         {
  297.             if (this.mouseDown)
  298.             {
  299.                 Point mousePosition = Control.MousePosition;
  300.                 this.mouseX = mousePosition.X - 515;
  301.                 mousePosition = Control.MousePosition;
  302.                 this.mouseY = mousePosition.Y - 20;
  303.                 base.SetDesktopLocation(this.mouseX, this.mouseY);
  304.             }
  305.         }
  306.  
  307.         private void panel2_MouseUp(object sender, MouseEventArgs e)
  308.         {
  309.             this.mouseDown = false;
  310.         }
  311.  
  312.         private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  313.         {
  314.             this.label1.Text = this.webBrowser1.Url.ToString();
  315.             string[] strArrays = this.webBrowser1.Url.ToString().Split(new char[] { '/' });
  316.            try
  317.             {
  318.                 if (strArrays[3] == "app")
  319.                 {
  320.                     this.textBox2.Text = strArrays[4];
  321.                 }
  322.             }
  323.             catch
  324.             {
  325.             }
  326.         }
  327.     }
  328. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement