@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The WTSShutdownSystem function shuts down (and optionally restarts) the specified terminal server. !!!!C# Signature: [DllImport("wtsapi32.dll", SetLastError=true)] public static extern int WTSShutdownSystem(IntPtr ServerHandle, long ShutdownFlags); !!!!VB Signature: <DllImport("wtsapi32.dll", SetLastError:=True)> _ Private Shared Function WTSShutdownSystem(ByVal hServer As IntPtr, ByVal ShutdownFlags As Long) As Integer End Function !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/termserv/termserv/wtsshutdownsystem.asp !!!!Tips & Tricks: Please add some! !!!!Sample Code: private const long WTS_WSD_REBOOT = 0x00000004; private const long WTS_WSD_SHUTDOWN = 0x00000002; [DllImport("wtsapi32.dll")] public static extern int WTSShutdownSystem(IntPtr ServerHandle, long ShutdownFlags); static void Main() { //WTS_CURRENT_SERVER_HANDLE = 0 WTSShutdownSystem(new IntPtr(0), WTS_WSD_REBOOT); } Documentation: WTSShutdownSystem@msdn on MSDN
Edit wtsapi32.WTSShutd...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.