C# (FORMLAR ARASI VERİ AKTARIMI)
















using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
     
        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frm=new Form2(listBox1);
            frm.ShowDialog();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            int secilen = listBox1.SelectedIndex;
            if (secilen > -1)
                listBox1.Items.RemoveAt(secilen);
            }
    }
}
//FORM2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication6
{
    public partial class Form2 : Form
    {
        ListBox lx;
        public Form2(ListBox lb)
        {
            InitializeComponent();
            lx = lb;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length > 0)
            {
                lx.Items.Add(textBox1.Text);
                textBox1.Clear();
               
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

C# (KULLANICI ADI VE ŞİFRE İLE FORMLAR ARASI GEÇİŞ)




using System; //FORM-1
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
       
            Form2 dgrfrm = new Form2();
        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text=="Admin" && textBox2.Text=="gkhan496")
            {
                dgrfrm.Show();  
            }
        }
    }
}
FORM-2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
           
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form1 frm1 = new Form1();
            frm1.Show();
        }
    }
}

C# (RANDOM KOMUTUYLA YAPILAN 2 OYUN)



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();


        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            int sayac = 1;
            Random rastgele = new Random();
            int deger;
            for (int i = 0; i < 6; i++)
            {
                deger = rastgele.Next(1, 49);
                if (sayac == 1)
                    label1.Text = deger.ToString();
                if (sayac == 2)
                    label2.Text = deger.ToString();
                if (sayac == 3)
                    label3.Text = deger.ToString();
                if (sayac == 4)
                    label4.Text = deger.ToString();
                if (sayac == 5)
                    label5.Text = deger.ToString();
                if (sayac == 6)
                    label6.Text = deger.ToString();
                sayac++;

            }
        }
        int tur = 0;
        int sayac = 1;
        int o1 = 0;
        int o2 = 0;
        private void button2_Click(object sender, EventArgs e)
        {
            int tursayisi;
            tur++;
            Random zarsayi = new Random();
            int zar;
            label14.Text = tur.ToString();
            bool t = Int32.TryParse(textBox1.Text, out tursayisi);

            if (t)
            {

                if (sayac == 1)
                {
                    zar = zarsayi.Next(1, 7);
                    o1 += zar;
                    label10.Text = o1.ToString();
                    sayac++;
                    label13.Text = "OYUNCU-2";
                }
                if (sayac == 2)
                {
                    zar = zarsayi.Next(1, 7);
                    o2 += zar;
                    label11.Text = o2.ToString();
                    sayac--;
                    label13.Text = "OYUNCU-1";
                }
            }
            if (tur == tursayisi)
            {
                if (o1 > o2)
                    MessageBox.Show("1.OYUNCU KAZANDI");
                else
                    MessageBox.Show("2.OYUNCU KAZANDI");
                button2.Visible = false;
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            button2.Visible = true;
            label10.Text = "0";
            label11.Text = "0";
            tur = 0;
            textBox1.Text=" ";
            label14.Text = "0";
            o1 = 0;
            o2 = 0;
           
        }

    }
}
KODTA ANLAMADIĞINIZ YERİ İLETİŞİM BÖLÜMÜNDEN SORABİLİRİSİNİZ EN KISA ZAMANDA YANIT GELİR YETER Kİ DOĞRU MAİL OLSUN...

C# (AT YARIŞI OYUNU)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        int birinciatsolauzaklik, ikinciatsolauzaklik, ucuncuatsolauzaklik;
        Random rastgele = new Random();
        private void Form1_Load(object sender, EventArgs e)
        {
            birinciatsolauzaklik = pictureBox1.Left;
            ikinciatsolauzaklik = pictureBox2.Left;
            ucuncuatsolauzaklik = pictureBox3.Left;

        }
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            pictureBox1.Location = new Point(12, 49);
            pictureBox2.Location = new Point(12, 177);
            pictureBox3.Location = new Point(12, 319);

        }


        private void timer1_Tick(object sender, EventArgs e)
        {
            int birinciatingenisligi = pictureBox1.Width;
            int ikinciatingenisligi = pictureBox2.Width;
            int ucuncuatingenisligi = pictureBox3.Width;
            pictureBox1.Left += rastgele.Next(5, 16);
            pictureBox2.Left += rastgele.Next(5, 16);
            pictureBox3.Left += rastgele.Next(5, 16);
            int bitisuzakligi = label5.Left;
            if (birinciatingenisligi + pictureBox1.Left >= bitisuzakligi)
            {
                timer1.Enabled = false;
                MessageBox.Show("1.AT KAZANDI");
            }
            if (ucuncuatingenisligi + pictureBox3.Left >= bitisuzakligi)
            {
                timer1.Enabled = false;
                MessageBox.Show("3.AT KAZANDI");
            }
            if (ikinciatingenisligi + pictureBox2.Left >= bitisuzakligi)
            {
                timer1.Enabled = false;
                MessageBox.Show("2.AT KAZANDI");
            }
        }
    }
}
Gerekli açıklamaları yapayım...
Öncelikle 3 tane atımız var bu atlar birer hareketli gif bunları http://www.hareketligifler.net/ bulabilirsiniz...Yarışımızı sınırlamak için label lar kullandık Labelın autosize değerini false ten true ya getirdik böylece boyutunu ayarlayıp rengini değiştiridik.
Bu atları birer picture box kullanarak formumuza ekliyoruz.
Daha sonra uzaklık ve genişlik değişkenlerini belirliyoruz bu kazanan atın hangisi olduğunu ve atları hareket ettirmek için gerekli.
Bunun için timer kullanıyoruz ve kodlarımızı timerin içine yazıyoruz
Timer bize sürekli aynı kodu çalıştırıcak.
Ve sonrada picture box umuzu hareket ettirmek için rastgele adında random değer alacağımız bir değişken tanımlayıp random değer aldırdık 5 ile 16 arasında böylece ilk at 7 ikinci at 8 değerini alırsa 2. at önde olacaktır bu olay finish çizgisine yani label5 e yetişene kadar sürecek.
Tekrar oyna butonuna ise picture boxların ilk konumlarını yazdık böylece herşey baştan başlayacak
Sağlıcakla kalın...

C# (MEDİA PLAYER KULLANIMI VE RADYO YAPIMI)
















ÖNCELİKLE BOŞ BİR FORM AÇIYORUZ SONRA TOOLBOXA GELİP SAĞ TIKLIYORUZ ORDAN CHOOSE ITEMS A TIKLIYORUZ VE SONRA COM COMPONENTS TEN WİNDOWS MEDİAPLAYER İ SECİYORUZ...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Media_Player
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void axWindowsMediaPlayer1_Enter(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.URL = "C:\\Users\\k\\Desktop\\model.mp3";
            /*Media playerda oynatmak istediklerinizi bu şekilde ekleyebilirsiniz
            dikkat edilmesi gereken yerler url nin uzantısı ve slash işaretleri
            */
           
        }

        private void button2_Click(object sender, EventArgs e)
        {
            axWindowsMediaPlayer1.URL = "http://kralpopwmp.radyotvonline.com:80 ";
            //mms adresini url kısmına yapıştırırsanız o radyo veya televizyon kanalına gider
            //Bu şekilde kendinize beğenidiğiniz radyo kanallarını ekleyebilirsiniz
            //Güncel radyo frekansları için http://radyodelisi.blogspot.com.tr/ ziyaret edebilrisiniz.
        }
    }
}

C# (TİMER KULLANIMI)
















using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Timer
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true; //Timer ı butondan başlattık isterseniz properties tende true olarak seçebilirsiniz
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = DateTime.Now.Second.ToString(); //Bu fonksiyonları kullanabilirsiniz
            //Veya kendinizin belirlediği bir sayi ile de çalıştırabilirisinz
        }

        private void button2_Click(object sender, EventArgs e)
        {
            timer2.Enabled = true;
        }
        int sayi = 0; //bu tip değişkenleri fonksiyon dışında tanımlamımız gerekir başlangıç değerleri döngü içinde yazılmaz.
        private void timer2_Tick(object sender, EventArgs e)
        {
         
            label2.Text = sayi.ToString(); //labela integer yazdıramayız...
            sayi++ //İnterval bölümünden hızını ayarlayabilirsiniz...

        }


    }

}

C# (TOOLBOXLARI ÖĞRENMEK İÇİN BASİT BİR UYGULAMA)
















using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication12
{
    public partial class Form1 : Form
    {
        double toplamF = 0.0;
        string[] meyveler = { "Elma", "Armut", "Domates", "Patlican", "Portakal" };
        double[] meyveF = { 1.0, 2.5, 2.0, 2.5, 3.0 };
     
        public Form1()
        {
            InitializeComponent();
            for (int i = 0; i < meyveler.Length;i++ )
                comboBox1.Items.Add(meyveler[i]);
            comboBox1.Text = "Seçiniz";
        }
        public void Bekle_Click(object sender, EventArgs e)
        {
         
            int kg;
            bool kadet = Int32.TryParse(textBox2.Text, out kg);

            if (kadet && kg > 0 && comboBox1.Text.Length > 0 && textBox2.Text.Length > -1)
            {
                Lav.Items.Add(comboBox1.Text);

                Lkg.Items.Add(kg + "Kg");

                for (int i = 0; i < meyveler.Length; i++)
                {
                    if (comboBox1.Text == meyveler[i])
                    {
                        LtoplamF.Items.Add(kg * meyveF[i] + "TL");
                        toplamF += meyveF[i] * kg;
                        Latutar.Text = toplamF.ToString() + "TL";
                    }

                }
                comboBox1.Text = "Seçiniz";
                textBox2.Text = "";
            }
        }
private void button1_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }
         private void button2_Click(object sender, EventArgs e)
         {

             int secilen=Lav.SelectedIndex;
           
             if(secilen >-1)
             {
                 double t;
                 double k = (double)LtoplamF.Items[secilen];
                 bool kb = double.TryParse(Latutar.Text, out t);
                 t-=k;
                 Latutar.Text=t.ToString();
                 Lav.Items.RemoveAt(secilen);
                 Lkg.Items.RemoveAt(secilen);
                 LtoplamF.Items.RemoveAt(secilen);
                 
             }
         }
    }
}

YAPICI VE YIKICI FONKSİYONLARIN KULLANIMI (C++ BASİT CLASS ÖRNEĞİ)

#include <iostream>
using namespace std;
class Diktortgen
{
public:
    int Yukseklik;
    int Genislik;
    int Alan;
    ~Diktortgen()
    {
        cout<<"Yok edildi "<<endl;
    }
    Diktortgen() //kurucu fonksiyon
    {
        cout<<"Gizlenmistim la nasil buldun :) "<<endl;
    }
    void VeriGir()
    {
        cout<<"Yukseklik gir : ";
        cin>>Yukseklik;
        cout<<"Genislik gir : ";
        cin>>Genislik;

    }
    void AlanBul()
    {
        Alan=Genislik*Yukseklik;
        cout<<"Dikdortgenin alani : "<<Alan<<endl;
    }

};
int main()
{
    Diktortgen A;
    A.VeriGir();
    A.AlanBul();
}

KENDİSİ HARİÇ POZİTİF TAM BÖLENLERİ (C++ BASİT CLASS ÖRNEĞİ)

#include <iostream>
using namespace std;
class sayi
{
public:
    int N;
    int Tambolen;
    void VeriGirisi()
    {
        cout<<"Islemi uygulamak istediginiz sayiyi giriniz :  ";
        cin>>N;
    }
    void tambolenbul()
    {
        for(int i=1;i<N;i++)
          if(N%i==0)
            cout<<i<<endl;
    }
 
};
int main()
{

    sayi bir;
    bir.VeriGirisi();
    bir.tambolenbul();
}

Milli Piyango Oyunu (C++) Biraz Düzensiz Oldu Onuda Siz Halledersiniz :)

#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
int main()
{
    int s1,s2,s3,s4,s5,r1,s6,r2,a1,a2,t1,t2,t3,t4,t5,t6,a3,a4,a5,a6,r3,r4,r5,r6;
    cout<<"Bilet numaranizi son haneden baslayarak : "<<endl;
    do
    {
        cout<<"6.rakam = " ;
        cin>>s6;
        if(s6>9)
            break;
        cout<<"5.rakam = ";
        cin>>s5;
        if(s5>9)
            break;
        cout<<"4.rakam = ";
        cin>>s4;
        if(s4>9)
            break;
        cout<<"3.rakam = ";
        cin>>s3;
        if(s3>9)
            break;
        cout<<"2.rakam = ";
        cin>>s2;
        if(s2>9)
            break;
        cout<<"1.rakam = ";
        cin>>s1;
        if(s1>9)
            break;
        cout<<"Bilet numaraniz : "<<s1<<" "<<s2<<" "<<s3<<" "<<s4<<" "<<s5<<" "<<s6<<endl;
    }
    while(s1=='*');

    cout<<endl;

    cout<<endl<<endl;
    srand (time(NULL));
     for (int i=0; i<1; i++)
     {
         r6=rand()%10;
         r5=rand()%10;
     r4=rand()%10;
        r3=rand()%10;
        r2=rand()%10;
        r1=rand()%10;
        a1=r1;
        a2=r2;
        a3=r3;
        a4=r4;
        a5=r5;
        a6=r5;
        if(((((a1==s6 && a2==s5)&& a3==s4)&&a4==s3)&&a5==s2)&&a6==s1)
        {
            t1=a1;
            t2=a2;
            t3=a3;
            t4=a4;
            t5=a5;
            t6=a6;

        }
        cout<<a6<<a5<<a4<<a3<<a2<<a1<<' ';
    }
  cout<<"SON ALTI RAKAMINA GORE KAZANANLAR "<<endl;
  if(t1<100)
    cout<<"HAYATTA CIKMAZ :) ";

     for (int i=0; i<5; i++)
     {

         r5=rand()%10;
     r4=rand()%10;
        r3=rand()%10;
        r2=rand()%10;
        r1=rand()%10;
        a1=r1;
        a2=r2;
        a3=r3;
        a4=r4;
        a5=r5;
        if((((a1==s6 && a2==s5)&& a3==s4)&&a4==s3)&&a5==s2)
        {
            t1=a1;
            t2=a2;
            t3=a3;
            t4=a4;
            t5=a5;
        }
cout<<a5<<a4<<a3<<a2<<a1<<' ';
    }
  cout<<"SON BES RAKAMINA GORE KAZANANLAR "<<endl;
  if(t1<100)
    cout<<"TEBRIKLER SON BES RAKAMINA GORE IKRAMIYE KAZANDINIZ";
    for (int i=0; i<5; i++)
    {   r4=rand()%10;
        r3=rand()%10;
        r2=rand()%10;
        r1=rand()%10;
        a1=r1;
        a2=r2;
        a3=r3;
        a4=r4;
        if(((a1==s6 && a2==s5)&& a3==s4)&&a4==s3)
        {
            t1=a1;
            t2=a2;
            t3=a3;
            t4=a4;
        }
cout<<a4<<a3<<a2<<a1<<' ';
    }
  cout<<"SON DORT RAKAMINA GORE KAZANANLAR "<<endl;
  if(t1<100)
    cout<<"TEBRIKLER SON DORT RAKAMINA GORE IKRAMIYE KAZANDINIZ";

    for (int i=0; i<5; i++)
    {
        r3=rand()%10;
        r2=rand()%10;
        r1=rand()%10;
        a1=r1;
        a2=r2;
        a3=r3;
        if((a1==s6 && a2==s5)&&a3==s4)
        {
            t1=a1;
            t2=a2;
            t3=a3;
        }
        cout<<a3<<a2<<a1<<' ';
    }cout<<"SON UC RAKAMA GORE KAZANANLAR ";
    cout<<endl;
    if(t1<100)
        cout<<"TEBRIKLER SON 3 RAKAMINA GORE IKRAMIYE KAZANDINIZ "<<endl;
    for (int i=0; i<10; i++)
    {
        r2=rand()%10 ;
        r1=rand()%10 ;
        a1=r1;
        a2=r2;
        cout<<a1<<a2<<' ';
        if(a2==s6 && a1==s5)
        {
            t1=a1;
            t2=a2;

        }
    }cout<<"SON IKI RAKAMA GORE KAZANANLAR ";
    cout<<endl;
    if(t1<100)
        cout<<"TEBRIKLER SON IKI RAKAMINA GORE IKRAMIYE KAZANDINIZ ";
    for(int i=0;i<2;i++)
    {
        r1=rand()%10;
        r2=rand()%10;
        a1=r1;
        a2=r2;
        if(a1==s6 || a2==s6)
            cout<<"AMORTI KAZANDIN KAZANDINIZ :)";
    }
    return 0;
}

STRUCT GÜZEL BİR ÖRNEK C++

#include <iostream>
using namespace std;
struct kisi
{
    char ad[100];
    char soyadi[100];
    int TCkimlikNo;
    int yas;
};
kisi verigirin()
{
    kisi gkhan;
    cout<<"Isim : ";
    cin>>gkhan.ad;
    cout<<"Soyisim : ";
    cin>>gkhan.soyadi;
    cout<<"TC kimlik no : ";
    cin>>gkhan.TCkimlikNo;
    cout<<"Yas : ";
    cin>>gkhan.yas;
    return gkhan;


}
void verigirparametre(kisi gkhan)
{
    kisi sami;
    cout<<"Isim : ";
    cin>>sami.ad;
    cout<<"Soyisim : ";
    cin>>sami.soyadi;
    cout<<"TC kimlik no : ";
    cin>>sami.TCkimlikNo;
    cout<<"Yas : ";
    cin>>sami.yas;



}
int main()
{
    kisi sami;
    kisi kim=verigirin();
    verigirparametre(sami);
}

Spring Boot Uygulamasını Heroku üzerinde Deploy Etme

Bu yazımızda sizlere spring boot ile yazılmış basit bir Rest api'nin heroku üzerinde nasıl deploy edebileceğimizi göstereceğim. Önce ...