zoukankan      html  css  js  c++  java
  • 终于装好了VS2013,开始!(一)

      VS下载安装速度之慢我已不想吐槽,正式开始吧!

    1. 新建一个项目:

    2. 选择模板:Visual C# --> 控制台应用程序,还可以为自己的项目重新命名、设定储存位置。

    3. 模板出来啦!

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace HelloWorld
     8 {
     9     class Program
    10     {
    11         static void Main(string[] args)
    12         {
    13         }
    14     }
    15 }

    4. 加上输出"Hello World!"的语句,并加上一句话使控制台在桌面上停留。

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace HelloWorld
     8 {
     9     class Program
    10     {
    11         static void Main(string[] args)
    12         {
    13             System.Console.WriteLine("Hello World!");   // output "Hello World!".
    14             Console.ReadLine();     // prevent the Console from disappearing immediately.
    15         }
    16     }
    17 }

    5. 点击运行

    6. 成功运行!

    简单的拓展一:加入几个语句调节控制台输出。

     1 using System;
     2 using System.Collections.Generic;
     3 using System.Linq;
     4 using System.Text;
     5 using System.Threading.Tasks;
     6 
     7 namespace HelloWorld
     8 {
     9     class Program
    10     {
    11         static void Main(string[] args)
    12         {
    13             Console.Title = "My Title"; // set the title of the Console.
    14             Console.ForegroundColor = ConsoleColor.Red; // set the color of words into Red.
    15             Console.BackgroundColor = ConsoleColor.Yellow; // set the background color into Red.
    16 
    17             Console.WriteLine("Hello World!");   // output "Hello World!".
    18             Console.ReadLine();     // prevent the Console from disappearing immediately.
    19         }
    20     }
    21 }

    现在的效果:

  • 相关阅读:
    日历生成器 v1.0 PHP
    原理
    Math.Round默认采用的不是四舍五入法, 而是四舍六入的银行家算法, 如何找回四舍五入法?
    .Net Attribute特性
    转: 如何删除windows service (How to delete a windows service)
    PowerShell入门
    Session, Cookie, Web.config中的cookieless总结
    Assembly.CreateInstance()与Activator.CreateInstance()方法 (转)
    Telnet与远程桌面
    Setting Meta Tags
  • 原文地址:https://www.cnblogs.com/yongheng20/p/4342619.html
Copyright © 2011-2022 走看看