简体   繁体   中英

Visual c# 2010 express compiling error

I am new with c# I am using windows 8 and I want to learn this lenguage, so I open a new proyect and it gives the basics and I only add a single extra line, that should prints a "hi" but when I compile it, it only shows a black window were it suppouse to be my "hi", for compiling I press F6 then when it is compiled I press CTRL+F5 and the black box open, in the tutorials that exact thing works, please help what should I do?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace intro1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("hola"); //this is the only line added by me
        }
    }
}

Since this is a console application, the "black box" is where the program runs. In the upper left-hand corner of the box is where you should see the word, "hola".

As the program ends immediately after the Console.WriteLine() , the "black box" (the console window) should disappear straight away.

To make it pause so you've got time to see what has been printed, add another line to your program:

Console.ReadKey();

this will cause the app to pause until you press a key.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM