© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago
.blate.

Im trying to open a program but i tyink my code is not working

My code is:
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 == "51.55.157511955")
{
// 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);
}
}


}
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Im trying to open another program but my code isn't working
C#CC# / help
3y ago
❔ I am trying to run my first C# code but it’s not working
C#CC# / help
3y ago
✅ trying to run NAudio to run a .wav file while running my code. But it is not working.
C#CC# / help
3y ago
Trying to build a program from GitHub but I get errors
C#CC# / help
3y ago