Linked Questions

0 votes
1 answer
341 views

Read windows start time for Win7 and Win10 via Visual Studio [duplicate]

I am able to read the start time from my Win7 computer. public static DateTime WindowsStartTime() { DateTime dt = new DateTime(); try { dt = DateTime.Now - new TimeSpan(0, 0, 0, ...
Ariwa's user avatar
  • 31
12 votes
9 answers
19k views

How to know when was Windows started or shutdown?

I need to develop a program in C# find out when was Windows started or shutdown. Is there a log file that I can read to know Windows start and shutdown times? Or do you have any ideas how to do so? ...
YAM's user avatar
  • 1,382
6 votes
9 answers
5k views

How to get the up time of the machine?

I would like to display the up time of the machine my code is running, how can I do that?
Mister Dev's user avatar
  • 10.3k
8 votes
4 answers
27k views

Auto-generate Unique ID within the constructor

Using VB.net, create a new class called staff, with three properties: Name , LastName, ID - should be suitable for use as a primary key in a database. Provide a class constructor to populate ...
Diana's user avatar
  • 283
9 votes
2 answers
16k views

Getting last reboot time [duplicate]

Possible Duplicate: Displaying the build date How to know when was Windows started or shutdown? for my purposes I am writing a C# executable that will calculate the difference in time (minutes) ...
Kevin Zhou's user avatar
  • 1,283
0 votes
2 answers
303 views

How to determine if windows restarted?

I want my WPF application run just one time. I have no problem with this. My problem is how can I determine if windows currently restarted?
Navid Rahmani's user avatar
2 votes
2 answers
3k views

How to Get Last Shutdown Time using C#

I have an application, that needs to get the last shutdown time. I have used EventLog class to get the shutdown time. I have separate class file that is designed to read/write event log. ...
user avatar
3 votes
4 answers
1k views

How to determine if the PC has been rebooted since my program's last run?

The title says it all. What is the best way to determine if the PC has been rebooted since my program's last run? Context: C# - Win XP and on A piece of hardware (PCIe board) that I'm configuring ...
jjames's user avatar
  • 31
2 votes
1 answer
1k views

How to get performance data?

I want to get the performance data like in the performance tab in the task manager window. I got this code: using (PerformanceCounter pCounter = new PerformanceCounter()) { ...
Liran Friedman's user avatar
2 votes
3 answers
634 views

Finding uptime of a program but showing it in MINUTES

So I run some type of game, and I want to add a command !uptime that displays how long server has been running for since the last open or whatever This code (from microsoft website) shows the tick ...
C126's user avatar
  • 31
0 votes
1 answer
757 views

How do I get system uptime in Mono on Ubuntu Server?

My code on Windows used P/Invoke to call GetTickCount64() from kernel32.dll This doesn't work under Mono on Ubuntu Server 14 - I get EntryPointNotFoundException. There's this approach using ...
sharptooth's user avatar
  • 169k
1 vote
2 answers
217 views

How to reset application settings after restarting Windows OS?

Background I have a C# windows Form application that sets its default top and left value based on the top and left value of the previous instance of the app opened. For example, app A opens at left=...
John Evans Solachuk's user avatar
1 vote
2 answers
238 views

How long the PC has been started?

I would like to know how long the PC has been started. That's why I made the following routine: Public Function LipPCIsOn() As String Dim iTempoPC As Integer Dim tTempoPC As TimeSpan Dim ...
Antony's user avatar
  • 83
0 votes
1 answer
150 views

trying to display the Start date from server

I have an application in C# where I want to show the Start Date from the server... I mean the real date since the server is running.... The goal is to know if the server went down in any moment. I´...
minoyo's user avatar
  • 95
0 votes
1 answer
100 views

C# Windows 10 find out when system was started

Is there any way to find out when Windows 10 was started? Advices from this page don't work properly. They return time of the last restart, and don't consider shut down events. I think it is connected ...
Oleh Khitrin's user avatar