1.获取windows版本信息 可以通过Windows API函数GetVersionEx来获得. 具体程序如下: Procedure Tform1.Button1Click(sender:TObject); Var OSVI:OSVERSIONINFO; begin OSVI.dwOSversioninfoSize:=Sizeof(OSVERSIONINFO): GetVersionEx(OSVI); label1.Caption:=IntToStr(OSVI.dwMinorVersion)+…
在应用程序中,有时需要在界面中显示计算机的硬件信息和进程信息.在.Net中提供了可以查询信息的类.Management类,在程序中添加应用后进行使用. 1 属性 类似的属性介绍可见下面: 属性介绍 根据以上的属性介绍可以查询常见的信息,比如内存,硬件等等.当然在内存信息中还有分类,在上述属性介绍中也有,同样通过代码也是可以获取. 2 编写流程 a 初始化 ManagementClass SystempMeg = new ManagementClass(syetemType); 其中systtem…
#!/usr/bin/env python # -*- coding: utf-8 -*- #http://www.cnblogs.com/liu-ke/ import wmi import os import sys import platform import time def sys_version(): c = wmi.WMI () #获取操作系统版本 for sys in c.Win32_OperatingSystem(): print "Version:%s" % sys.…
#!/usr/bin/env python # -*- coding: utf-8 -*- #http://www.cnblogs.com/liu-ke/ import wmi import os import sys import platform import time def sys_version(): c = wmi.WMI () #获取操作系统版本 for sys in c.Win32_OperatingSystem(): print "Version:%s" % sys.…
Unit CPUid; Interface Type TCpuType = (cpu8086, cpu286, cpu386, cpu486, cpuPentium); Function CpuType : TCpuType; Function CpuTypeString : String; Implementation Uses SysUtils; Function CpuType : TCpuType; ASSEMBLER; Asm // 8086 CPU 检测 push ds pushf…
需引用System.Management命名空间, 具体代码如下: public class SysProp { public SysProp() { ManagementObjectSearcher PhysicalMemory = new ManagementObjectSearcher("select * from Win32_PhysicalMemory"); ManagementObjectSearcher Processor = new ManagementObjectSe…
Python用WMI模块获取Windows系统的硬件信息:硬盘分区.使用情况,内存大小,CPU型号,当前运行的进程,自启动程序及位置,系统的版本等信息. 本文实例讲述了python使用wmi模块获取windows下的系统信息 监控系统 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47…
奇怪的工作,制作的是一款办公应用软件,领导却要求我统计用户计算机的物理信息,什么CPU的型号.核心数,什么内存信息等各种乱七八糟的用户信息.我想问,现在用户的信息就这么没有隐私性了么?想获取就获取传递到后台--无奈我只是民工,还是老老实实做了.然后查阅了一些资料,主要用到了System.Management命名空间下的信息(System.Management 命名空间 | Microsoft Docs). 1.引用 在查询计算机硬件或者操作系统的信息时,使用ManagementObjectSea…
http://www.cnblogs.com/hnxxcxg/archive/2013/01/30/2882672.html 如果WINDOWS系统的短日期格式为“yyyy/m/d”,执行下面的代码会报错:2013-01-29 00:00:00不是合法的日期procedure TFrmQuerySale.FormShow(Sender: TObject);varsDate: string;begininherited;// 默认查当天的销售数据sDate := FormatDateTime('y…
如果WINDOWS系统的短日期格式为“yyyy/m/d”,执行下面的代码会报错:2013-01-29 00:00:00不是合法的日期procedure TFrmQuerySale.FormShow(Sender: TObject);varsDate: string;begininherited;// 默认查当天的销售数据sDate := FormatDateTime('yyyy-mm-dd', Now);DateTimePicker1.DateTime := StrToDateTime(sDat…