How to play Bad "Hello World" with C # on vs.

Source: Internet
Author: User

How to play Bad "Hello World" with C # on vs.

In order to develop WIN8 applications, re-installed the system to win8.1, the VS2013 Ultimate version, we began to use C #, today to play "Hello world."

First, open vs and build a console application. My build path is C:\Users\ZhangXiao\Desktop\, project name is Consolehelloworld.

, type a line of code, invoke the WriteLine function of the console class in the System namespace, and output a sentence on the console.

The first method, open the CMD command prompt and use the CD command to enter the C:\Users\ZhangXiao\Desktop\ConsoleHelloWorld\ConsoleHelloWorld\bin\Debug folder, Then open the ConsoleHelloWorld.exe file and you will see the output of the statement.

The second way is to CTRL+F5 and run the program.

After that, test some of the functions in the console, Foregroundcolor and Backgroundcolor,windowheight. Note that the value of Windowcolor cannot exceed 50, otherwise it overflows.

As a result, the color and window size can be changed!

Using the StreamWriter class output TXT file, note the namespaces for adding System.Text and System.IO, and note that the close () function is called last, otherwise it cannot be generated.

The file is generated!

How to play Bad "Hello World" with C # on vs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.