Hakkımda

1984 Manisa doğumluyum, 9 yaşımdan beri bilgisayarlara ilgi duymaya başladım. Fakat Maddi olumsuzluklar derken ilk bilgisyarıma 15 yaşımda kavuştum. 17 yaşında Progralamaya ve Oyun Motorlarına ilgi duydum. Visual Basic 6.0 öğrendim. Daha sonra VB.NET piyasaya çıktı ama kısa bir süre sonra Visual C#.NET isteklerime daha iyi yanıt verdi. Orta seviyede C#.NET, ASP.NET ve MSSQL bilgilerimle kendi çapımda projeler geliştirmekteyim. Son Yakın zamanlarda da Sistem Uzmanlığı kursuna başlamış bulunuyorum. Ayrıca Fireworks, Dreamveawer, PHP ve MySQL üzerinde de kendimi geliştirmekteyim. Son olarakta Bosch Termoteknik A.Ş'de Bilgi İşlem Departmanında Help Desk ve Server Operation destek elemanı olarak çalışıyorum.

20.08.2010

Visual C#.NET ile Basit Net Arama Motoru

Aslında bu başlık biraz saçma oldu farkındayım :) Uyduramadım kafamdan bişeyler. Program windows tabanlıdır. Yapaccağınız şeyler belli aslında... Metin kutusuna kelimeyi gir arama yapılacak motoru seç ara ya bas varsayılan tarayıcın o rayı açıp aramayı yapsın :D C# ile yapılan bu projede sizlere biraz programcılık mantığını kavratmak en büyük hedefim olacaktı. Ama artık sizin yeteneklerinize kalmış :D
Ben size projeyi ekte sunuyorum. Neler yaptığmı rahatlıkla görebilceksiniz. Kıymetimi bilin kaynak kodlarıyla gönderiom:)



Alın İşte Kaynak Kodlar
MainProgram.CS

/*
 * Created by SharpDevelop & Egemen Güngör.
 * User: Egemen Güngör
 * Date: 13.08.2010
 * Time: 14:35
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace BasitNetArama
{
    /// <summary>
    /// Description of MainForm.
    /// </summary>
    public partial class MainForm : Form
    {
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
           
            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
        }
       
        void MainFormLoad(object sender, EventArgs e)
        {
            //Form yüklendiğinde ComboBox a ilk değeri getirir.
            cbSite.SelectedIndex=0;
           
            //Formun başlığını ayarlar ve yanına tarih saat ekler:)
            this.Text="Basit Net Arama Motoru / " +DateTime.Now.ToString();
        }
       
        void BtnSearchClick(object sender, EventArgs e)
        {
            //Arama yapılacak site stringlerini tanımladık.
            string gword;
            string yword;
            string bword;
           
            //Google arama için
            if (cbSite.SelectedIndex==0)
            {
                gword="http://www.google.com.tr/search?hl=tr&q=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(gword);
            }
           
            //Yahoo arama için
            else if (cbSite.SelectedIndex==1)
            {
                yword="http://search.yahoo.com/search;_ylt=AupFumUcXev0CO.CXTbopZzWHX8V?p=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(yword);
            }
           
            //Bing arama için
            else if (cbSite.SelectedIndex==2)
            {
                bword="http://www.bing.com/search?q=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(bword);
            }
        }
       
        //Burası TextBox ın keyPress Event(olay)'ının gerçekleştiği yer
        void TxtSearchWordsKeyPress(object sender, KeyPressEventArgs e)
        {
            //Stringlerimizi tanımladık
            string gword;
            string yword;
            string bword;
           
            //Eğer cbsite=0(google) seçili ve Enter tuşuna basılırsa arama başlatılacak
            if (e.KeyChar==13 && cbSite.SelectedIndex==0)
                {
                gword="http://www.google.com.tr/search?hl=tr&q=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(gword);
                e.Handled=false;
            }
           
            //Eğer cbsite=1(yahoo) seçili ve Enter tuşuna basılırsa arama başlatılacak
            else if (cbSite.SelectedIndex==1)
            {
                yword="http://search.yahoo.com/search;_ylt=AupFumUcXev0CO.CXTbopZzWHX8V?p=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(yword);
                e.Handled=false;
            }
           
            //Eğer cbsite=2(bing) seçili ve Enter tuşuna basılırsa arama başlatılacak
            else if (cbSite.SelectedIndex==2)
            {
                bword="http://www.bing.com/search?q=" + txtSearchWords.Text;
                System.Diagnostics.Process.Start(bword);
                e.Handled=false;
            }
           
           
        }
       
    }
}

MainForm.Designer.cs
/*
 * Created by SharpDevelop.
 * User: gue2iz
 * Date: 13.08.2010
 * Time: 14:35
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
namespace BasitNetArama
{
    partial class MainForm
    {
        /// <summary>
        /// Designer variable used to keep track of non-visual components.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
       
        /// <summary>
        /// Disposes resources used by the form.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing) {
                if (components != null) {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }
       
        /// <summary>
        /// This method is required for Windows Forms designer support.
        /// Do not change the method contents inside the source code editor. The Forms designer might
        /// not be able to load this method if it was changed manually.
        /// </summary>
        private void InitializeComponent()
        {
            this.lblSearchWords = new System.Windows.Forms.Label();
            this.txtSearchWords = new System.Windows.Forms.TextBox();
            this.cbSite = new System.Windows.Forms.ComboBox();
            this.lblSearchSite = new System.Windows.Forms.Label();
            this.btnSearch = new System.Windows.Forms.Button();
            this.lblInfo = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // lblSearchWords
            //
            this.lblSearchWords.Font = new System.Drawing.Font("Bosch Office Sans", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.lblSearchWords.ForeColor = System.Drawing.Color.SteelBlue;
            this.lblSearchWords.Location = new System.Drawing.Point(12, 9);
            this.lblSearchWords.Name = "lblSearchWords";
            this.lblSearchWords.Size = new System.Drawing.Size(144, 23);
            this.lblSearchWords.TabIndex = 0;
            this.lblSearchWords.Text = "Aranacak Kelime(ler):";
            //
            // txtSearchWords
            //
            this.txtSearchWords.Font = new System.Drawing.Font("Bosch Office Sans", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.txtSearchWords.ForeColor = System.Drawing.Color.SteelBlue;
            this.txtSearchWords.Location = new System.Drawing.Point(12, 24);
            this.txtSearchWords.Name = "txtSearchWords";
            this.txtSearchWords.Size = new System.Drawing.Size(207, 21);
            this.txtSearchWords.TabIndex = 1;
            this.txtSearchWords.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TxtSearchWordsKeyPress);
            //
            // cbSite
            //
            this.cbSite.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbSite.Font = new System.Drawing.Font("Bosch Office Sans", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.cbSite.ForeColor = System.Drawing.Color.Crimson;
            this.cbSite.FormattingEnabled = true;
            this.cbSite.Items.AddRange(new object[] {
                                    "Google",
                                    "Yahoo",
                                    "Bing"});
            this.cbSite.Location = new System.Drawing.Point(225, 23);
            this.cbSite.Name = "cbSite";
            this.cbSite.Size = new System.Drawing.Size(121, 22);
            this.cbSite.TabIndex = 2;
            //
            // lblSearchSite
            //
            this.lblSearchSite.Font = new System.Drawing.Font("Bosch Office Sans", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.lblSearchSite.ForeColor = System.Drawing.Color.Crimson;
            this.lblSearchSite.Location = new System.Drawing.Point(225, 9);
            this.lblSearchSite.Name = "lblSearchSite";
            this.lblSearchSite.Size = new System.Drawing.Size(104, 23);
            this.lblSearchSite.TabIndex = 3;
            this.lblSearchSite.Text = "Aranacak Site:";
            //
            // btnSearch
            //
            this.btnSearch.Font = new System.Drawing.Font("Bosch Office Sans", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.btnSearch.ForeColor = System.Drawing.Color.DarkOrange;
            this.btnSearch.Location = new System.Drawing.Point(352, 21);
            this.btnSearch.Name = "btnSearch";
            this.btnSearch.Size = new System.Drawing.Size(75, 23);
            this.btnSearch.TabIndex = 4;
            this.btnSearch.Text = "Ara...";
            this.btnSearch.UseVisualStyleBackColor = true;
            this.btnSearch.Click += new System.EventHandler(this.BtnSearchClick);
            //
            // lblInfo
            //
            this.lblInfo.Font = new System.Drawing.Font("Bosch Office Sans", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
            this.lblInfo.ForeColor = System.Drawing.Color.DodgerBlue;
            this.lblInfo.Location = new System.Drawing.Point(279, 84);
            this.lblInfo.Name = "lblInfo";
            this.lblInfo.Size = new System.Drawing.Size(161, 16);
            this.lblInfo.TabIndex = 3;
            this.lblInfo.Text = "Created By Egemen Güngör";
            //
            // MainForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(441, 99);
            this.Controls.Add(this.btnSearch);
            this.Controls.Add(this.cbSite);
            this.Controls.Add(this.txtSearchWords);
            this.Controls.Add(this.lblSearchWords);
            this.Controls.Add(this.lblInfo);
            this.Controls.Add(this.lblSearchSite);
            this.Name = "MainForm";
            this.Text = "Basit Net Arama";
            this.Load += new System.EventHandler(this.MainFormLoad);
            this.ResumeLayout(false);
            this.PerformLayout();
        }
        private System.Windows.Forms.ComboBox cbSite;
        private System.Windows.Forms.Label lblSearchWords;
        private System.Windows.Forms.TextBox txtSearchWords;
        private System.Windows.Forms.Label lblSearchSite;
        private System.Windows.Forms.Button btnSearch;
        private System.Windows.Forms.Label lblInfo;
    }
}
Program.cs
/*
 * Created by SharpDevelop.
 * User: gue2iz
 * Date: 13.08.2010
 * Time: 14:35
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Windows.Forms;

namespace BasitNetArama
{
    /// <summary>
    /// Class with program entry point.
    /// </summary>
    internal sealed class Program
    {
        /// <summary>
        /// Program entry point.
        /// </summary>
        [STAThread]
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
       
    }


İyi Çalışmlar

Hiç yorum yok:

Yorum Gönder