Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Making a shutdown timer. Need help with the 'timer'


  • Please log in to reply

#1
Alaster

Alaster

    Member

  • Member
  • PipPip
  • 59 posts
i am making a shutdown timer for practice (and i need one that actually works how i need it to)
basically i got it to shutdown on demand, but i cant delay it. I have the GUI there and everything i just dont know how to put it together.
So what i need is a way to delay shutdown.exe using a combo box or somethig.

Ps i am using visual studio 2008.
Thanks.
(please help im tryin to get most of it done before school starts again)
  • 0

Advertisements


#2
Alaster

Alaster

    Member

  • Topic Starter
  • Member
  • PipPip
  • 59 posts
help please!!!
  • 0

#3
Tom331

Tom331

    Member

  • Member
  • PipPip
  • 18 posts
Well I don't know visual studio 2008, but here's a general method. Get the system time, put it in a variable then keep getting them time till it has increased by X amount. eg start time = 07:00:00 you want it to shutdown after an hour, when the time = 08:00:00 start shutting down.
There may also be a build in timer function in vs08 but I don't know
  • 0

#4
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 33,101 posts
If you want to shutdown after a certain amount of time, you can use the Sleep Method.
In VB.Net the call would look like this:
System.Threading.Thread.Sleep(milliseconds)
where milliseconds is an integer that tell the program how many milliseconds to wait before it continues.

More information:
http://msdn.microsof...y/d00bd51t.aspx
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP