Solved

how to count the no of times  windows xp professional  booting in particular days using vb.net programme?

Posted on 2011-09-22
6
201 Views
Last Modified: 2012-08-13
my os is win xp professional.
I want to wirte programme in vb.net.
how many number of times windows xp has shut down and  rebooted.
how to calculate this in vb.net.
0
Comment
Question by:tamilsoft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 14

Accepted Solution

by:
Allan Nisbet earned 250 total points
ID: 36585982
You could achieve this quite simply using the number of boots as the pc must have shutdown for it to boot.

Create an application that is set to startup on pc boot
Add a textbox to the form, call it frmMain in this example

Under applications settings create a new setting called PCBOOT

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
dim PCBoots as string

PCBoots = my.settings.PCBOOT
PCBoots = PCBoots + 1

My.Settings.PCBOOT = PCBoots
My.Settings.Save()
End Sub

Open in new window


This will increase the PCBoot count on a restart as the app only runs at pc startup

Hope this helps

I coded this from memory so might be some things needing declared in your Imports

Storm
0
 

Author Comment

by:tamilsoft
ID: 36586830
is there no option through windows registry ?
0
 
LVL 14

Expert Comment

by:Allan Nisbet
ID: 36587581
Not that I can think of off top of my head

Storm
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 10

Expert Comment

by:LMiller7
ID: 36590840
Other than running a VB program at bootup the only way I know would be to parse the system event log. Don't ask me how to do that. I am quite sure the information you want is not in the registry..
0
 
LVL 28

Expert Comment

by:Dr. Klahn
ID: 36592558
A simple and non-intrusive way could be to read the XP event logs for start and stop events.  This method can be implemented in VB.NET using the EventLog VB.NET class.

This method has the advantages that a) the time is as precise as possible, b) no changes need be made to the machine, c) it can be implemented over a network.
0
 
LVL 66

Assisted Solution

by:johnb6767
johnb6767 earned 250 total points
ID: 36602159
"is there no option through windows registry ?"

No. Event Log is about the most accurate way....  (no points, just confirming the above...)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question