Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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,036 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