I can’t seem to figure out how to use || and && in the same if statement ‘and, or’ being keywords for google it wasn’t really easy to google i got something like this
this.Hide();
if (txt_Password.Text == "karasumyo2022" && txt_UserName.Text == "whatever" || "somethingelse" )
{
new Form1().Show();
this.Hide();
}
any ideas?
>Solution :
You can use something like this by making use of brackets:
if (txt_Password.Text == "karasumyo2022" &&
(txt_UserName.Text == "whatever" || txt_UserName.Text == "somethingelse" ))
// ^ ^
{
new Form1().Show();
this.Hide();
}