-8
     private void button1_Click(object sender, EventArgs e)
    {

        string answer = (@"class SecLevel \n { \n static void Main()\n{Console.WriteLine("Hello World!");}}");
        if (textBox1.Text == answer)
        {
            MessageBox.Show( "Good!");
        }
    }
John Saunders
  • 160,644
  • 26
  • 247
  • 397

1 Answers1

0

It is because of the "Hello World!" you need to escape the ",

do this instead:

            "class SecLevel \\n { \\n static void Main()\\n{Console.WriteLine(\"Hello World!\");}}"
TheLethalCoder
  • 6,668
  • 6
  • 34
  • 69