2_ 바삭바삭 프로그래밍/C# and Visual C++
[C#] What can I use instead of getch() in C#?
준환이형님_
2012. 6. 29. 00:12
나는, 없나 싶어서 계속 명령어만 찾고 있었는데,
외국사람들은 필요하니까 이렇게도 쓰더라.. 멋져!
출처 : http://cboard.cprogramming.com/csharp-programming/74269-what-can-i-use-instead-getch-csharp.html
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport("msvcrt")]
static extern int _getch();
static void Main(string[] args)
{
Console.WriteLine("Hello world");
Console.WriteLine("Press any key to end..");
_getch();
}
}
}