Example #1
0
        protected override void FillFloppyDriveInfo()
        {
            ManagementObjectCollection moc = this.GetAllInfo(this.WSql);

            foreach (ManagementObject mo in moc)
            {
                Win32PageFileUsage csp = new Win32PageFileUsage();
                if (mo != null)
                {
                    csp.AllocatedBaseSize = GetManagementObject <uint>(mo, "AllocatedBaseSize");
                    csp.Caption           = GetManagementObject <string>(mo, "Caption").ToString();
                    csp.CurrentUsage      = GetManagementObject <uint>(mo, "CurrentUsage");
                    csp.Description       = GetManagementObject <string>(mo, "Description").ToString();
                    csp.Cim_InstallDate   = GetManagementObject <string>(mo, "InstallDate").ToString();
                    csp.Name      = GetManagementObject <string>(mo, "Name").ToString();
                    csp.PeakUsage = GetManagementObject <uint>(mo, "PeakUsage");
                    csp.Status    = GetManagementObject <string>(mo, "Status");
                    ps.Add(csp);
                }
            }
            moc.Dispose();
        }
 public PageFileUsageCounter(string ip, string username, string password)
 {
     wp = new WmiPageFileUsage(ip, username, password);
     pf = wp.Win32PageFileUsages[0];
 }
 public PageFileUsageCounter()
 {
     wp = new WmiPageFileUsage();
     pf = wp.Win32PageFileUsages[0];
 }