Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
Available now!
Buy at Amazon US or
Buy at Amazon UK



Articles

1.Windows API reference
2.HTML to WML Converter
3.Webcam streaming in VB.NET
4.Remoting with firewalls
5.RSA from first principles
6.Key & MouseLogger in .NET
7.Networking Resource Kit for .NET
8.Automatic Reboot with .NET
9.XAML Schema
10.Migrating VB6 Winsock to VB.NET
11.Migrating C++ sockets to C#
12.RFC Reference guide
13.Lingua - Localization webservice
14.COM Reference guide
15.WMI Reference guide
16.SQL stored procedures
17.TCP & UDP port reference
18..NET Framework reference
19.Ethernet Type codes
21.MAC address assignments
22.DLL entry point reference
23.WHOIS server list
24. Turing Numbers
25. Boost SQL performance
26. Progress Bar in ASP.NET
27. OleDb WebService
27. Internet Explorer

Contact us

   

Private Declare Function ExitWindowsEx Lib "user32" (ByVal dwOptions As _ Integer, ByVal dwReserved As Integer) As Integer

Private Declare Function GetCurrentProcess Lib "kernel32" () As Integer

Private Declare Function OpenProcessToken Lib "advapi32" (ByVal _ ProcessHandle As Integer, ByVal DesiredAccess As Integer, ByRef TokenHandle As Integer) As Integer

Private Declare Function LookupPrivilegeValue Lib "advapi32"  Alias _ "LookupPrivilegeValueA"(ByVal lpSystemName As String, ByVal lpName As _ String, ByRef lpLuid As Form1.LUID) As Integer

Private Declare Function AdjustTokenPrivileges Lib "advapi32" (ByVal _ TokenHandle As Integer, ByVal DisableAllPrivileges As Integer, ByRef _ NewState As Form1.TOKEN_PRIVILEGES, ByVal BufferLength As Integer, ByRef _ PreviousState As Form1.TOKEN_PRIVILEGES, ByRef ReturnLength As Integer) As _ Integer

     

These functions are actually implemented in DLLs contained within the windows operating system, namely user32.dll, kernel32.dll and advapi32.dll.

Finally, a reference to the interoperation services namespace is required

C#

using System.Runtime.InteropServices;

VB.NET

imports System.Runtime.InteropServices

If you are using VB.NET you will need to add a reference (project > Add reference) to Microsoft Visual Basic .NET compatibility runtime. This allows for the more friendly API declarations, which account for much of the structure changes between the C# and VB.NET versions of this application.

To test this application, run it from Visual Studio .NET. Use the field provided to change the reboot time to some time in the future. Ensure that all your work is saved, then check ‘Enable automatic reboot’. Then sit back and watch your computer switch itself off when the timer reaches the designated time.

 

Page 3 


Google

Copyright 2012 Open Merchant Account Ltd.
Free SMS UK Free SMS Ireland SMS Gratis Norway SMS Gratis Sverige Ilmainen SMS Suomi SMS Gratis Danmark SMS Tasuta Eestisse SMS Nemokamai Lietuva SMS Bezmaksas Latviju Darmowe smsy Polska SMS Zdarma Ceské SMS Zdarma Slovensko SMS Gratis Deutschland SMS Gratis Schweiz SMS Gratis Österreich SMS Gratuit Belgique SMS Gratis Nederland SMS Gratuit France SMS Gratis España SMS Gratis Portugal Free SMS South Africa Free SMS USA SMS Percuma Malaysia Free SMS Hong Kong