在做项目的时候需要这样一个功能,让控制台程序不能随意关闭。找了半天资料,终于通过WINDOWS的API完美解决了。如下
代码
using
System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport(
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication1
{
class Program
{
[DllImport(