Bat
Bat
CC#
Created by Bat on 11/14/2023 in #help
Im trying to open another program but my code isn't working
When i press login it doesnt work
8 replies
CC#
Created by Bat on 11/14/2023 in #help
Im trying to open another program but my code isn't working
using System; using System.Diagnostics; using System.Windows.Forms; namespace Gletch { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void btnLogin_Click(object sender, EventArgs e) { string username = txtUsername.Text; string password = txtPassword.Text; try { // Basit bir doğrulama kontrolü if (username == "admin" && password == "abc") { // Kullanıcı adı ve şifre doğruysa başka bir programı aç Process process = new Process(); process.StartInfo.FileName = @"C:\Users\bayza\Downloads\fabric-installer-0.11.2.exe"; process.StartInfo.UseShellExecute = true; process.Start(); } else { // Yanlış kullanıcı adı veya şifre durumunda burada bir hata mesajı gösteriyorum. MessageBox.Show("Yanlış Kullanıcı Adı veya Şifre", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { // Hata durumunda hatayı göster MessageBox.Show($"Hata: {ex.Message}", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
8 replies
CC#
Created by Bat on 11/14/2023 in #help
Im trying to open another program but my code isn't working
here is my code:
8 replies