当前位置: 网站首页 > .NET > c#

Visual C# .NET 入门:步骤 3. 程序结构

时间:1970-1-1 08:33:31来源: c#作者:admin 点击:0次 字体 [ С]
 步骤 3. 程序结构

    既然我们已经构建了一个简单的 Hello World 应用程序,那么就让我们停下来分析一下 Visual C# 应用程序的基本组成部分。

    源代码注释字符 // 将行的剩余部分标记为一个注释,这样 C# 编译器就会忽略它。另外,/* 和 */ 之间的代码也会被当作注释。

// This line is ignored by the compiler.
/* This block of text is also
ignored by the Visual C# compiler. */

    Using 指令。NET 框架为开发人员提供了许多有用的类。例如,Console 类处理对控制台窗口的输入和输出。这些类是按照层次树的形式组织的。Console 类的完全限定名实际上是 System.Console.其他的类包括 System.IO.FileStream 和 System.Collections.Queue.

    using 指令允许您在不使用完全限定名的情况下引用命名空间中的类。以斜体突出显示的 代码应用了 using 指令。

using System;
class Class1
{
    static void Main(string[] args)
    {
        System.Console.WriteLine ("Hello, C#.NET World!");
发表评论
验证码:
最新评论