public void cari_resi() { string data; bool find = false; string[] dataarr; F = new FileStream("DataTransaksi.txt", FileMode.Open, FileAccess.Read); R = new StreamReader("DataTransaksi.txt"); while ((data = R.ReadLine()) != null) { dataarr = data.Split('#'); if (TxCariResi.Text == dataarr[0]) { find = true; label2.Text = dataarr[0]; getResi = TxCariResi.Text; MessageBox.Show("Resi Ditemukan!"); FormKurir fk = new FormKurir(); fk.ShowDialog(); break; } } if (!find) { MessageBox.Show("Resi tidak ada!"); } }
public void Login2() { string data; bool find = false; string[] dataarr; F = new FileStream("Kurir.txt", FileMode.Open, FileAccess.Read); R = new StreamReader("Kurir.txt"); while ((data = R.ReadLine()) != null) { dataarr = data.Split('#'); if (TxUsername.Text == dataarr[4] && TxPassword.Text == dataarr[5]) { find = true; MessageBox.Show("Selamat Datang"); FormKurir FK = new FormKurir(); Hide(); FK.ShowDialog(); break; } } if (!find) { MessageBox.Show("Password Kamu Salah"); } }