Results 1 to 2 of 2

Thread: Create code that tells me when a user has restarted a pc

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2015
    Posts
    1

    Create code that tells me when a user has restarted a pc

    I'm building a program, and in that program I'd like to put a code that lets me know the last time a user has restarted the PC. I'm running a help desk here at my job and the users here like to lie about if they've restarted their PC or not, so I'd like a way to be able to see if they've really restarted it recently or not. Is this possible? If so can I get the code/sample code for this?

    Any help would be appreciated.
    Thanks.

  2. #2
    PowerPoster kaliman79912's Avatar
    Join Date
    Jan 2009
    Location
    Ciudad Juarez, Chihuahua. Mexico
    Posts
    2,593

    Re: Create code that tells me when a user has restarted a pc

    Look at Environment.TickCount Property, it will tell you the ticks since the system started.

    This property cycles from a negative number to a positive, which are the Int32 Signed min and max values, to make it cycle from 0 to Max, do something like:

    Dim myTics As Integer = (Environment.TickCount And Int32.MaxValue)
    More important than the will to succeed, is the will to prepare for success.

    Please rate the posts, your comments are the fuel to keep helping people

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width