展开全部
Function GetMainboardSerialNumber() As String
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim objItem
Dim strOption
Dim colItems
GetMainboardSerialNumber = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
For Each objItem In colItems
If objItem.SerialNumber <> "" Then
GetMainboardSerialNumber = objItem.SerialNumber
Exit Function
End If
Next
End Function
获取主板型号内存大小..等...?自己去实践一下吧
On Error Resume Next
Dim strComputer
Dim objWMIService
Dim objItem
Dim strOption
Dim colItems
GetMainboardSerialNumber = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard")
For Each objItem In colItems
If objItem.SerialNumber <> "" Then
GetMainboardSerialNumber = objItem.SerialNumber
Exit Function
End If
Next
End Function
获取主板型号内存大小..等...?自己去实践一下吧
2012-03-25
展开全部
网上找到的 应该是好用的 我手里没有vb 你试验一下吧!~ Function GetMainboardSerialNumber() As String On Error Resume Next Dim strComputer Dim objWMIService Dim objItem Dim strOption Dim colItems GetMainboardSerialNumber = "" strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_BaseBoard") For Each objItem In colItems If objItem.SerialNumber <> "" Then GetMainboardSerialNumber = objItem.SerialNumber Exit Function End If Next End Function
~
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询