Jump to content

C# help

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
jendomatic

jendomatic

    Newbie

  • Members
  • Pip
  • 5 posts
I am writing a program to ask a user to enter a security code. If the security code is correct, a certain message comes up etc.

 
if (!int.TryParse(codeInput, out securityCode))
{
Console.WriteLine("{0} is a number!", codeInput);
Console.ReadLine();
 
}

I tried the code above but it didn't work, It only work my ageInput code. What am I doing wrong?

Edited by James.H, 24 March 2010 - 06:48 AM.


#2
CanadianTaco

CanadianTaco

    Newbie

  • Members
  • PipPip
  • 17 posts
Maybe a message box with an if statement would work better?
 if (textBox1.Text == "password")

            {

                messagebox.show("message goes here");

            }

            else

            {

                return;

            }

        }  

Edited by CanadianTaco, 24 March 2010 - 04:49 AM.
code edit