#YYYY-MM-DD HH:MM:SS 에서 MM이 변경되면 출력
#YYYY-MM-DD HH:MM:SS 에서 MM이 변경되면 출력
#YYYY-MM-DD HH:MM:SS 에서 MM이 변경되면 출력
using System;
using System.IO;
using System.Timers;
namespace ____trigia_pyeongchon
{
class Program
{
public static void Main(string[] args)
{
___proud_hill pro = new ___proud_hill();
pro.running();
}
}
class ___proud_hill
{
ConsoleKeyInfo keyinfo;
int xpos,ypos;
Timer tm;
string ____old_month, ____now_month;
public void running()
{
tm = new Timer();
tm.Interval = 1000;
xpos=ypos=2;
____old_month="INIT";
____now_month="INIT";
tm.Elapsed += new ElapsedEventHandler(__time_tick);
tm.Start();
Logging("Start");
while(true)
{
keyinfo = Console.ReadKey(true);
if(keyinfo.Key == ConsoleKey.RightArrow) xpos++;
else
if(keyinfo.Key == ConsoleKey.LeftArrow) xpos--;
else
if(keyinfo.Key == ConsoleKey.UpArrow) ypos++;
else
if(keyinfo.Key == ConsoleKey.DownArrow) ypos++;
else
if(keyinfo.Key == ConsoleKey.Escape) break;
if(keyinfo.KeyChar=='+')
{
tm.Stop();
tm.Interval += 10;
tm.Start();
}
else
if(keyinfo.KeyChar=='-')
{
tm.Stop();
tm.Interval -= 10;
tm.Start();
}
Logging("Key");
}
tm.Stop();
tm.Elapsed -= __time_tick;
Logging("Stop");
}
void __time_tick(object sender, ElapsedEventArgs e)
{
ypos++;
Logging("Time");
}
void Logging(string msg)
{
DateTime now;
now = DateTime.Now;
____now_month = now.ToString("mm");
if(____now_month != ____old_month)
{
if(____old_month !="INIT" )
{
Console.WriteLine("Minute is changed!!!!!, KeyBoard HIT is needed!!");
}
}
Console.WriteLine("Debug>>Time:" + now.ToString("yyyy-MM-dd hh:mm:ss") +
" YYYY:" + now.ToString("yyyy") +
" MM:" + now.ToString("MM") +
" mm:" + now.ToString("mm") +
" Pos:[" + ypos.ToString("000000") + "," + xpos.ToString("000000") + "]" +
" Interval:" + tm.Interval +
" Event:" + msg);
____old_month = ____now_month;
}
} //end of class
} //end of namespace
'c# 언어' 카테고리의 다른 글
public enum ConsoleKey (0) | 2021.08.09 |
---|---|
닷넷 프레임워크 ,알아보기,ㅡㅡ,ㅡㅡ (0) | 2021.07.26 |
Redis>RPUSH & BLPOP Usage (0) | 2021.07.15 |
Redis Server를 이용한 데이타 저장(Key,Value)과 불러오기(Key) (0) | 2021.07.13 |
Color.FromArgb List (0) | 2021.07.09 |