RE: a couple quick c# questions.

  • From: Jamal Mazrui <empower@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Thu, 10 Apr 2008 08:40:55 -0400 (EDT)

I just tried but could not find a .NET method for restarting the
computer.  A Google search found this page:

How to shutdown and restart windows from within a c# program - MSDN
Forums
http://64.233.167.104/search?q=cache:7HouvvtddiEJ:forums.microsoft.com/MSDN/ShowPost.aspx%3FPostID%3D2286961%26SiteID%3D1+site:microsoft.com+c%23+restart+windows&hl=en&ct=clnk&cd=1&gl=us

A few people recommended calling a shutdown utility of the operating
system as follows:

System.Diagnostics.Process.Start("ShutDown", "/s");

List of all arguments:

-r    Shutdown and restart the computer
-s    Shutdown the computer
-t xx    Set timeout for shutdown to xx seconds
-a    Abort a system shutdown
-f    Forces all windows to close
-i    Display GUI interface
-l    Log off

Hope this helps,
Jamal


On
Wed, 9 Apr 2008, Ken Perry
wrote:

> Date: Wed, 9 Apr 2008 22:36:48 -0700
> From: Ken Perry <whistler@xxxxxxxxxxxxx>
> Reply-To: programmingblind@xxxxxxxxxxxxx
> To: programmingblind@xxxxxxxxxxxxx
> Subject: RE: a couple quick c# questions.
>
>
>
> The windows forms namespace holds all the GUI stuff you would have to
> include other libraries for rebooting the system and I am not sure which one
> off the top of my head.
>
> Ken
>
>
>   _____
>
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler
> Littlefield
> Sent: Wednesday, April 09, 2008 5:38 PM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: a couple quick c# questions.
>
>
> Hello,
> I'm not totally sure how to do references... I'll have to figure that out.
> Also, will the Windows.Forms namespace hold the api? things like restarting
> the comp, etc etc?
> Thanks,
>
> ----- Original Message -----
> From: Ken  <mailto:whistler@xxxxxxxxxxxxx> Perry
> To: programmingblind@xxxxxxxxxxxxx
> Sent: Wednesday, April 09, 2008 6:21 PM
> Subject: RE: a couple quick c# questions.
>
> All you have to do is do
>
> using System.Windows.Forms
>
> Then you can use things like MessageBox and I think you can even do the
> system menu but I have never tried to.  You will also have to add a
> reference to the .net library for windows.forms but that is pretty simple
> to.
>
> Ken
>
>   _____
>
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Tyler
> Littlefield
> Sent: Wednesday, April 09, 2008 5:02 PM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: a couple quick c# questions.
>
>
> Hello,
> I've got a couple questions. I'm looking for a class, that would allow me to
> add a drop-down menu onto the system menu of a console.
> Also, is there a way to either a, put a console into a windows app, or b,
> use the windows namespace in a console? There are a ton of things I'd like
> to do with the console, working on a program via a console, but I need more
> flexability--accessing the windows namespace would help, or... Is there
> another way to get to the API functions without using the windows namespace?
> Thanks,
> ~~TheCreator~~
>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: