编写第一个C#应用程序 using System; namespace P 1_1 { class Program { static void Main() { Console. Write. Line("Welcome to. NET"); } } }
C#程序的基本结构 类型 命名 空间 方法 using System; namespace P 1_1 { class Program { static void Main() { Console. Write. Line("Welcome to. NET"); } } }
C#程序的基本结构 类型 调用 命名 空间 引用 方法 调用 using System; namespace P 1_1 { class Program { static void Main() { Console. Write. Line("Welcome to. NET"); } } }
C#程序的基本结构 注释 //程序清单P 1_1. cs using System; namespace P 1_1 { class Program { static void Main() { Console. Write. Line("Welcome to. NET"); } } }
与用户进行交互 程序 参数 using System; namespace P 1_3 { class Program { static void Main(string[] args) { Console. Write("你好, "); Console. Write. Line(args[0]); } } } 使用 参数
与用户进行交互 Windows 程序对象 using System; using System. Windows. Forms; namespace P 1_6 { static class Program { static void Main() { Application. Run(new Form()); } } } 启动主 窗体