zoukankan      html  css  js  c++  java
  • 第 2 章 编写 C# 程序

    2.1  Visual Studio 2005开发环境

    2.2  控制台应用程序

      试试看:创建一个简单的控制台应用程序

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                // Output text to the screen
                Console.WriteLine("The first app in Beginning C# Programming!");
                Console.ReadKey();
            }
        }
    }
    View Code

       控制台窗口会在执行完毕后立即关闭,使用 Console.ReadKey(); 告诉代码在结束钱等待按键。

    2.3  Windows Forms应用程序

      试试看:创建一个简单的Windows应用程序

     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Windows.Forms;
     9 
    10 namespace WindowsFormsApplication1
    11 {
    12     public partial class Form1 : Form
    13     {
    14         public Form1()
    15         {
    16             InitializeComponent();
    17         }
    18 
    19         private void button1_Click(object sender, EventArgs e)
    20         {
    21             MessageBox.Show("The first Windows app in the book!");
    22         }
    23     }
    24 }
    View Code
  • 相关阅读:
    ggplot2 上篇
    R笔记1
    读书笔记 第2章 数据挖掘概述
    读书笔记 数据化营销
    [LeetCode] 172. 阶乘后的零
    [LeetCode] 171. Excel表列序号
    [LeetCode] 169. 求众数
    知乎使用selenium反爬虫的解决方案
    [LeetCode] 168. Excel表列名称
    [LeetCode] 167. 两数之和 II
  • 原文地址:https://www.cnblogs.com/liuliu3/p/3756194.html
Copyright © 2011-2022 走看看