ManagementScope scope = new ManagementScope(@"root\cimv2"); // Create a query to get the build number. ObjectQuery query = new ObjectQuery("SELECT LastBootUpTime FROM Win32_OperatingSystem"); // Execute the query. ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, queryObj); ManagementObjectCollection queryCollection = searcher.Get(); string lastBootupTime=""; foreach (ManagementObject m in queryCollection) { lastBootupTime= = ManagementDateTimeConverter.ToDateTime(mo["LastBootUpTime"].ToString()); break; }
LastBootUpTime
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)