VB制作个读取系统信息的文件
由于要统计单位电脑的软硬件及外设,手工操作太慢效率低,希望有达人能帮忙用VB做个软件,代码最好贴出O(∩_∩)O。要求查看的有:工作组,计算机名称,所装的系统,IP地址,...
由于要统计单位电脑的软硬件及外设,手工操作太慢效率低,希望有达人能帮忙用VB做个软件,代码最好贴出O(∩_∩)O。要求查看的有:工作组,计算机名称,所装的系统,IP地址,CPU信息,内存大小,硬盘容量,是否有光驱及打印机以及它们的型号。最好能把读取的信息以TXT格式自动保存到该软件所在的目录里。谢谢,我把所有的分送上。
问题补充:邮箱:137823738@qq.com 展开
问题补充:邮箱:137823738@qq.com 展开
展开全部
用VB6.0取得系统信息技巧
问题要一个一个解决,最好不要一下子提这么多,积累多了,就会有很多的收获。
问题要一个一个解决,最好不要一下子提这么多,积累多了,就会有很多的收获。
参考资料: http://tech.163.com/04/1119/11/15I1T6IF0009rt.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不是小工程的。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如有问题请在百度里写信给我
FORM1里控件:LISTBOX,COMMAND
在窗体里加入如下代码::
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA(ByVal nDrive As String) As Long" ()
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Const DRIVE_FIXED = 3
Private Sub COMMAND1_Click()
Dim s, System, item
Dim i As Integer
Set System = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
For Each item In System
List1.AddItem ("计算机名称: " & item.Name)
List1.AddItem ("状态: " & item.Status)
List1.AddItem ("类型: " & item.SystemType)
List1.AddItem ("生产厂家: " & item.Manufacturer)
List1.AddItem ("型号: " & item.Model)
List1.AddItem ("内存: " & item.totalPhysicalMemory \ 1024 \ 1024 & "MB")
List1.AddItem ("域: " & item.domain)
'List1.AddItem ("工作组" & item.Workgroup)
List1.AddItem ("当前用户: " & item.username)
List1.AddItem ("启动状态: " & item.BootupState)
List1.AddItem ("该计算机属于: " & item.PrimaryOwnerName)
List1.AddItem ("系统类型: " & item.CreationClassName)
List1.AddItem ("计算机类型: " & item.Description)
For i = 0 To 1 '这里假设安装了两个系统
List1.AddItem ("启动选项" & i & ": " & item.SystemStartupOptions(i))
Next i
Next
End Sub
Private Sub Form_Load() '作初始化设置
Command1.Caption = "测试硬盘"
Form1.Caption = "测试硬盘程序"
Label1.WordWrap = True
Label1.Caption = ""
Label2.WordWrap = True
Label2.Caption = ""
End Sub
创建模块,添加如下代码:
Public Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Public Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
FORM1里控件:LISTBOX,COMMAND
在窗体里加入如下代码::
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA(ByVal nDrive As String) As Long" ()
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Const DRIVE_FIXED = 3
Private Sub COMMAND1_Click()
Dim s, System, item
Dim i As Integer
Set System = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")
For Each item In System
List1.AddItem ("计算机名称: " & item.Name)
List1.AddItem ("状态: " & item.Status)
List1.AddItem ("类型: " & item.SystemType)
List1.AddItem ("生产厂家: " & item.Manufacturer)
List1.AddItem ("型号: " & item.Model)
List1.AddItem ("内存: " & item.totalPhysicalMemory \ 1024 \ 1024 & "MB")
List1.AddItem ("域: " & item.domain)
'List1.AddItem ("工作组" & item.Workgroup)
List1.AddItem ("当前用户: " & item.username)
List1.AddItem ("启动状态: " & item.BootupState)
List1.AddItem ("该计算机属于: " & item.PrimaryOwnerName)
List1.AddItem ("系统类型: " & item.CreationClassName)
List1.AddItem ("计算机类型: " & item.Description)
For i = 0 To 1 '这里假设安装了两个系统
List1.AddItem ("启动选项" & i & ": " & item.SystemStartupOptions(i))
Next i
Next
End Sub
Private Sub Form_Load() '作初始化设置
Command1.Caption = "测试硬盘"
Form1.Caption = "测试硬盘程序"
Label1.WordWrap = True
Label1.Caption = ""
Label2.WordWrap = True
Label2.Caption = ""
End Sub
创建模块,添加如下代码:
Public Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
Public Type SYSTEM_INFO
dwOemID As Long
dwPageSize As Long
lpMinimumApplicationAddress As Long
lpMaximumApplicationAddress As Long
dwActiveProcessorMask As Long
dwNumberOrfProcessors As Long
dwProcessorType As Long
dwAllocationGranularity As Long
dwReserved As Long
End Type
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询