C# – form application giriş ekranı (login form) YAZILI

S

Spoidead

Confirmed Memb.
Joined
Oct 21, 2019
Messages
59
Reaction score
390
C Sharp Form Application’da 2 farklı form kullanarak bir giriş ekranı (login form) yaptık.Kullanıcıdan giriş için Kullanıcı adı ve şifre isteniyor eğer doğru ise kullanıcı 2.forma yönlendiriliyor.
1571684366008.png

Eğer kullanıcı adı ve şifre doğru ise 2.formumuz açılıyor ve formumuzda girişin başarılı olduğu gösteriliyor.Ve uygulamayı kapatmak için bir çıkış butonu bulunuyor.


1571684390106.png

Eğer girişimiz başarılı değil ise bir message box ile girişin başarısız olduğu gösteriliyor ve giriş ekranındaki kullanıcı adı ve şifre bölümü yeni bir giriş için siliniyor.


1571684412205.png

FORM 1
C#:
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 FormIslemleriGirisEkrani
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void buttonGiris_Click(object sender, EventArgs e)
        {//http://realitycheats.com/
            Form2 yeni = new Form2();// form 2'ye daha sonra ulaşmak için yeni bir method belirliyoruz.
            if (textBoxKullaniciAd.Text == "admin" && textBoxKullaniciSifre.Text == "12345")
            {//Kullanıcı adı ve şifremizi belirliyoruz ve doğru olması durumunda yapılması gereken işlemleri yazıyoruz.
                yeni.Show();//Burada daha önceden belirlediğimiz methoda göre 2.formu göster diyoruz.
                this.Hide();//Burada ise bulunduğumuz form olan 1.formu gizliyoruz.
            }//http://realitycheats.com/
            else {//eğer kullanıcı adı ve şifre doğru değil ise yapılacaklar.
                MessageBox.Show("Giriş Başarısız");
                //Bir message box ile "giriş başarısız" ifadesini gösteriyoruz.
                textBoxKullaniciAd.Clear();
                //Yeni bir giriş için kullanıcı adı bölümünü temizliyoruz.
                textBoxKullaniciSifre.Clear();
                //Yeni bir giriş için şifre bölümünü temizliyoruz.
            }//http://realitycheats.com/
 
        }
    }
}

FORM 2
C#:
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 FormIslemleriGirisEkrani
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }
 
        private void label1_Click(object sender, EventArgs e)
        {        }
 
        private void Form2_Load(object sender, EventArgs e)
        {        }
 
        private void buttonCikis_Click(object sender, EventArgs e)
        {
            //http://realitycheats.com/
            Application.Exit();
            //Uygulamayı kapatmak için butona uygulamayı kapat komutu veriyoruz.
        }
    }
}
 
SPAM IS FORBIDDEN!
  • SPAMMERS ARE BANNED FROM THE FORUM AND CANNOT USE ANY OF THE CHEATS
  • For example: thanks, thx, very good, asdqwe, working, ty and so on!
  • For example: Writing the same message over and over. thanks, thx and so on!
  • Copying and copying someone else's message is prohibited.
  • It is forbidden to send messages to increase the number of comments on threads that you have no knowledge of.
  • Write your own opinion when commenting!
  • If you see spam message, please let us know with the REPORT button!

Tema düzenleyici

Top Bottom