C#完成在掌握台輸入以後體系時光的辦法。本站提示廣大學習愛好者:(C#完成在掌握台輸入以後體系時光的辦法)文章只能為提供參考,不一定能成為您想要的結果。以下是C#完成在掌握台輸入以後體系時光的辦法正文
本文實例講述了C#完成在掌握台輸入以後體系時光的辦法。分享給年夜家供年夜家參考。詳細完成辦法以下:
//C#完成的小掌握台法式: 靜態輸入以後時光
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
/// <summary>
/// 掌握台靜態輸入時光小法式
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
Console.Title = "掌握台靜態顯示時光小法式";
Console.WindowHeight = 3;//掌握台高度
Console.WindowWidth = 50;//掌握台寬度
while(true)//一個逝世輪回
{
Console.WriteLine("以後體系時光是:{0}",DateTime.Now);
//以後體系時光
System.Threading.Thread.Sleep(1000);
//以後主線程sleep
Console.Clear();
//清屏
}
}
}
}
願望本文所述對年夜家的C#法式設計有所贊助。