Wrox Programmer Forums
|
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 20th, 2006, 07:01 AM
Registered User
 
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Shutdown using VB.NET

hi,

  How to shutdown a system using .NET code. In VB6 we were using
ExitWindowsEx() API function to shut down the system. In VB.NET. What code should be included to shutdown,logoff or restart a system,
Thank you,
By,
Ashok Kumar. K


 
Old September 20th, 2006, 07:37 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You need to import 3 dlls:

user32.DLL, advapi32.DLL, and kernel32.DLL

the MSDN has a good article on the appropriate way to import these dlls to call those various functions.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
 
Old September 20th, 2006, 03:57 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Could you give a link (or more) to the MSDN article? (Or the title if it is in the MSDN that loads with .NET?)
 
Old September 21st, 2006, 01:38 AM
Registered User
 
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default



thanks dparsons,
Its worthful for me...



 
Old September 21st, 2006, 10:36 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

sure:

http://blogs.msdn.com/brad_mccabe/ar...02/383542.aspx

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
program to run before window shutdown? rocky0893 VB How-To 0 June 20th, 2007 05:33 AM
windowsXP shutdown program malikabid Visual Basic 2005 Basics 2 September 19th, 2006 05:46 AM
How do I get the shutdown time mwalters VB How-To 1 December 30th, 2004 07:57 AM
How to start and shutdown an instance of Oracle kumar_rajeshk Oracle 1 May 5th, 2004 01:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.