rado84

SearchProgramCode

Jun 30th, 2016
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Diagnostics;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11.  
  12. namespace WinForms_GoogleSearch
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20.  
  21. private void textBox1_TextChanged(object sender, EventArgs e)
  22. {
  23. string input = textBox1.Text;
  24.  
  25. string output = input.Replace(' ', '+');
  26. string output2 = input.Replace('#', "%23");
  27. }
  28.  
  29. private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
  30. {
  31. if (comboBox1.SelectedIndex == 0)
  32. {
  33. string input = textBox1.Text;
  34. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text);
  35. }
  36.  
  37. if (comboBox1.SelectedIndex == 1)
  38. {
  39. string input = textBox1.Text;
  40. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text +" site:"+ comboBox1.Text);
  41. }
  42.  
  43. if (comboBox1.SelectedIndex == 2)
  44. {
  45. string input = textBox1.Text;
  46. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  47. }
  48.  
  49. if (comboBox1.SelectedIndex == 3)
  50. {
  51. string input = textBox1.Text;
  52. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  53. }
  54.  
  55. if (comboBox1.SelectedIndex == 4)
  56. {
  57. string input = textBox1.Text;
  58. Process.Start("www.google.bg/#newwindow=1&q=" + textBox1.Text + " site:" + comboBox1.Text);
  59. }
  60. }
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment