展开全部
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 type memorystatus
dwlength as long
dwmemoryload as long
dwtotalphys as long
dwavailphys as long
dwtotalpagefile as long
dwavailpagefile as long
dwtotalvirtual as long
dwavailvirtual as long
end type
const sm_cxscreen = 0
const sm_cyscreen = 1
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 declare sub globalmemorystatus lib "kernel32" (lpbuffer as memorystatus)
private declare sub getsysteminfo lib "kernel32" (lpsysteminfo as system_info)
private declare function getsystemmetrics lib "user32" (byval nindex as long) as long
private declare function wnetgetconnection lib "mpr.dll" alias "wnetgetconnectiona" (byval lpszlocalname as string, byval lpszremotename as string, cbremotename as long) as long
dim sinfo as system_info
dim minfo as memorystatus
private sub combo1_click()
dim x as long
dim cl1 as long
dim cl2 as long
dim sec1 as long
dim byt1 as long
dim buff as string
buff = combo1.text + ":\"
x = getdrivetype(buff)
select case x
case 2
label1.caption = "该驱动器是可移动驱动器"
case 3
label1.caption = "该驱动器是固定驱动器"
case 4
label1.caption = "该驱动器是网络驱动器"
case 5
label1.caption = "该驱动器是cd-rom驱动器"
case 6
label1.caption = "该驱动器是ramdisk驱动器"
case else
label1.caption = "该驱动器无效"
end select
x = getdiskfreespace(buff, sec1, byt1, cl1, cl2)
if x then
cl1 = cl1 * sec1 * byt1
cl2 = cl2 * sec1 * byt1
label2.caption = "该驱动器总共容量 " + format$(cl2, "##########0") + " 字节"
label3.caption = "该驱动器可用容量 " + format$(cl1, "##########0") + " 字节"
else
label2.caption = ""
label3.caption = ""
end if
end sub
private sub form_load()
dim x as long
dim buff as string
for i = 0 to 25
buff = chr$(65 + i) + ":\"
x = getdrivetype(buff)
if x > 1 then
combo1.additem chr$(65 + i)
end if
next i
combo1.text = "c"
combo1_click
x = getsystemmetrics(sm_cxscreen)
label4.caption = "显示器水平分辨率 " + str$(x)
x = getsystemmetrics(sm_cyscreen)
label5.caption = "显示器垂直分辨率 " + str$(x)
call getsysteminfo(sinfo)
select case sinfo.dwprocessortype
case 386
case 486
case 586
label6.caption = "计算机处理器类型 p5"
case else
end select
call globalmemorystatus(minfo)
label7.caption = "物理内存总容量 " + str$(minfo.dwtotalphys) + " 字节"
label8.caption = "可用物理内存 " + str$(minfo.dwavailphys) + " 字节"
label10.caption = "虚拟内存总容量 " + str$(minfo.dwtotalvirtual) + " 字节"
label11.caption = "可用虚拟内存 " + str$(minfo.dwavailvirtual) + " 字节"
end sub
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 type memorystatus
dwlength as long
dwmemoryload as long
dwtotalphys as long
dwavailphys as long
dwtotalpagefile as long
dwavailpagefile as long
dwtotalvirtual as long
dwavailvirtual as long
end type
const sm_cxscreen = 0
const sm_cyscreen = 1
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 declare sub globalmemorystatus lib "kernel32" (lpbuffer as memorystatus)
private declare sub getsysteminfo lib "kernel32" (lpsysteminfo as system_info)
private declare function getsystemmetrics lib "user32" (byval nindex as long) as long
private declare function wnetgetconnection lib "mpr.dll" alias "wnetgetconnectiona" (byval lpszlocalname as string, byval lpszremotename as string, cbremotename as long) as long
dim sinfo as system_info
dim minfo as memorystatus
private sub combo1_click()
dim x as long
dim cl1 as long
dim cl2 as long
dim sec1 as long
dim byt1 as long
dim buff as string
buff = combo1.text + ":\"
x = getdrivetype(buff)
select case x
case 2
label1.caption = "该驱动器是可移动驱动器"
case 3
label1.caption = "该驱动器是固定驱动器"
case 4
label1.caption = "该驱动器是网络驱动器"
case 5
label1.caption = "该驱动器是cd-rom驱动器"
case 6
label1.caption = "该驱动器是ramdisk驱动器"
case else
label1.caption = "该驱动器无效"
end select
x = getdiskfreespace(buff, sec1, byt1, cl1, cl2)
if x then
cl1 = cl1 * sec1 * byt1
cl2 = cl2 * sec1 * byt1
label2.caption = "该驱动器总共容量 " + format$(cl2, "##########0") + " 字节"
label3.caption = "该驱动器可用容量 " + format$(cl1, "##########0") + " 字节"
else
label2.caption = ""
label3.caption = ""
end if
end sub
private sub form_load()
dim x as long
dim buff as string
for i = 0 to 25
buff = chr$(65 + i) + ":\"
x = getdrivetype(buff)
if x > 1 then
combo1.additem chr$(65 + i)
end if
next i
combo1.text = "c"
combo1_click
x = getsystemmetrics(sm_cxscreen)
label4.caption = "显示器水平分辨率 " + str$(x)
x = getsystemmetrics(sm_cyscreen)
label5.caption = "显示器垂直分辨率 " + str$(x)
call getsysteminfo(sinfo)
select case sinfo.dwprocessortype
case 386
case 486
case 586
label6.caption = "计算机处理器类型 p5"
case else
end select
call globalmemorystatus(minfo)
label7.caption = "物理内存总容量 " + str$(minfo.dwtotalphys) + " 字节"
label8.caption = "可用物理内存 " + str$(minfo.dwavailphys) + " 字节"
label10.caption = "虚拟内存总容量 " + str$(minfo.dwtotalvirtual) + " 字节"
label11.caption = "可用虚拟内存 " + str$(minfo.dwavailvirtual) + " 字节"
end sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询