using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace ConsoleApplication2
{
    class Program
    {
        [DllImport("kernel32.dll")]
        static extern IntPtr GetCurrentProcess();
 
        [DllImport("kernel32.dll", SetLastError = true)]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool TerminateProcess(IntPtr hProcess, uint uExitCode);
 
        static void Main(string[] args)
        {
            IntPtr handle;
            uint excode = 2;
            handle = GetCurrentProcess();
            TerminateProcess(handle, excode);
 
            Console.WriteLine("This code will not be executed!");
 
        }
    }
}
 
pinvoke.txt · Последние изменения: 2010/09/02 19:45 — 85.173.192.171
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki