小寒的blog
Programming is a darned hard thing—but I am going to like it.

C# 程序可由一个或多个文件组成。每个文件都可以包含零个或零个以上的命名空间。一个命名空间除了可包含其他命名空间外,还可包含类、结构、接口、枚举、委托等类型。以下是 C# 程序的主干,它包含所有这些元素。

// A skeleton of a C# program 
using System;
namespace YourNamespace
{
    
class YourClass
    {
    }

    
struct YourStruct
    {
    }

    
interface IYourInterface 
    {
    }

    
delegate int YourDelegate();

    
enum YourEnum 
    {
    }

    
namespace YourNestedNamespace
    {
        
struct YourStruct 
        {
        }
    }

    
class YourMainClass
    {
        
static void Main(string[] args) 
        {
            
//Your program starts here
        }
    }
}

posted on 2007-06-10 20:14  xhan  阅读(371)  评论(0编辑  收藏  举报