您的位置:首页 > 编程语言 > C#

C#控制台程序按任一键退出

2008-01-24 17:06 260 查看
1using System;
2using System.Runtime.InteropServices;
3
4namespace ConsoleApplication1
5{
6	/// <summary>
7	/// Summary description for Class1.
8	/// </summary>
9	class Class1
10	{
11		[DllImport("msvcrt.dll")]
12		static extern bool system(string str);
13
14		/// <summary>
15		/// The main entry point for the application.
16		/// </summary>
17		[STAThread]
18		static void Main(string[] args)
19		{
20			system("pause");
21		}
22	}
23}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: