时 间 记 忆
最 新 评 论
专 题 分 类
最 新 日 志
最 新 留 言
搜 索
用 户 登 录
友 情 连 接
博 客 信 息
 
 
Visual Basic取得系统的信息代码
[ 2007-10-9 9:49:00 | By: 程咬玉 ]
 
有时候我们需要取得操作系统的相关信息,这在一些软件里也是经常用到的,那么如何在VB里实现这个功能呢?请看下面的代码:

以下是引用片段:
Private 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
  Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
  Private Sub Command1_Click()
  Dim len5 As Long, aa As Long
  Dim sysinfo As SYSTEM_INFO
  Call GetSystemInfo(sysinfo)
  End Sub
  注:
  dwProcessorType
  Platform Value
  ============ ===============================
  Windows 95 PROCESSOR_INTEL_386 = 386
  PROCESSOR_INTEL_486 = 486
  PROCESSOR_INTEL_PENTIUM = 586
  Windows NT PROCESSOR_INTEL_386
  PROCESSOR_INTEL_486
  PROCESSOR_INTEL_PENTIUM
  PROCESSOR_MIPS_R4000 4000
  PROCESSOR_ALPHA_21046 21046

  这里用到了API函数,大家一定要对API函数有所了解
 



阅读全文() | 回复(0) | 引用通告() | 编辑 | 推荐
 

发表评论:

    昵称:
    密码: (游客无须输入密码)
    主页:
    标题:
 
     
Powered by Chinaitlab.com