Video How to: Create a C# Console Application

Create C# Console ApplicationVideo How To

Authors: Kathleen McGrath, Harry Miller, Jo Molnar, Microsoft Corporation

Applies to: Microsoft Visual C# 2008 Express Edition

Length: 00:04:12 | Size: 20.6 MB | Type: WMV file

 

Watch the video

Download the video and transcript

Read the step-by-step article

Video Summary

A console application is the simplest form of C# program. Because console applications perform all their input and output at the command line, they are ideal for quickly trying out language features and writing command-line utilities.

This video shows you how to create a console application that lists all of the files in the root directory of your computer's C:\ drive. The following tasks are included in the process:

  • How to create a new console application.

  • How to view Solution Explorer.

  • How to use IntelliSense to make typing code faster and more accurate.

  • How to build and run your application.

The Visual C# Help includes the code and the steps that are demonstrated in this video. See How to: Create a C# Console Application.

Additional Video Resources

Video How Tos

Other Videos

Additional Help Resources

Tags :


Community Content

James Haydon
Cannot download videos
I don't know why, but for some reason I cannot either watch or download any of the videos for the studio. Anyone help? In advance, many thanks, much appreciated, JnH
Tags :

Kathleen McGrath - MSFT
re Cannot downlod videos
I am able to download (and stream) the video. When you click the "Download the video and transcript" link, it should display a zip file named CreateACSharpConsoleApp.zip that you can either open or save. Is that not the case?
Tags :

gerry lowry
@"C:\" explained for beginners
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"C:\");

in the above statement, a beginner might not get the significance of the @ character.

without the @ character, the \ (back slash) character would need to be escaped:
System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo("C:\\");
The \\ above is equivalent to a single \ character.

More information
----------------------
Without the @ character, \\ is necessary because \" means a double quotation mark.
Therefore, the c# compiler would consider "C:\" incomplete and would expect "C:\"" and
that would mean a bad argument C:" would be passed to System.IO.DirectoryInfo.

more notes about the @ character in the annotation at http://msdn.microsoft.com/en-us/library/ezwyzy7b.aspx.

and in this thread: http://forums.asp.net/p/1478091/3442612.aspx.


Regards ~~ Gerry Lowry

Page view tracker