
Kısaca program Listboxlara eklenen mail ve şifreleri mail:şifre şeklinde kayıt etmeye yarıyor
Acemice kodladığım için hata vs. çıkabilir test sırasında problem yaşamadım

Kullanımı Basit Zaten :
1. Mail Ekleye basıp listeye ekliyoruz
2. Şifre Ekleye basıp listeye ekliyoruz
3. Eşleştir Diyoruz Bitti
4. Şifreleri .txt olarak kayıt ediyor
5. Mail ve şifre sayıları eşit olmalı yoksa çalışmaz
Download Linki :
https://dosya.co/0yzw5c07kd3i/Şifre_Eşleştirme.rar.html
Kaynak Kodları :
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; using System.IO; namespace Şifre_Eşleştirme { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void DosyaOkuVeEkle(ListBox listBox) { try { if (openFileDialog1.ShowDialog() == DialogResult.OK) { using (StreamReader sr = new StreamReader(openFileDialog1.FileName)) { string satir; while ((satir = sr.ReadLine()) != null) { listBox.Items.Add(satir); } } } } catch (Exception ex) { MessageBox.Show("Dosya okuma hatası: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } private void button1_Click(object sender, EventArgs e) { DosyaOkuVeEkle(listBox1); } private void button2_Click(object sender, EventArgs e) { DosyaOkuVeEkle(listBox2); } private void button3_Click(object sender, EventArgs e) { try { if (listBox1.Items.Count != listBox2.Items.Count) { MessageBox.Show("Mail ve Şifre Sayıları Eşit Değil Lütfen Kontrol Edin.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } using (SaveFileDialog saveFileDialog = new SaveFileDialog()) { saveFileDialog.Filter = "Yeni Metin Belgesi|*.txt"; if (saveFileDialog.ShowDialog() == DialogResult.OK) { using (StreamWriter sw = new StreamWriter(saveFileDialog.FileName)) { for (int i = 0; i < listBox1.Items.Count; i++) { string satir = $"{listBox1.Items[i]}:{listBox2.Items[i]}"; sw.WriteLine(satir); } } MessageBox.Show("Şifreler Başarıyla Kaydedildi."); } } } catch (Exception ex) { MessageBox.Show("Dosya kaydetme hatası: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }