以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何获取系统位数  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=85795)

--  作者:jiskin
--  发布时间:2016/6/2 20:22:00
--  [求助]如何获取系统位数
想在FT里获取系统是32位还是64 有什么简单的方法么?
--  作者:大红袍
--  发布时间:2016/6/2 20:24:00
--  

msgbox(IntPtr.Size)

 

如果是4,就是32位,如果是8,就是64位


--  作者:jiskin
--  发布时间:2016/6/2 20:31:00
--  
以下是引用大红袍在2016/6/2 20:24:00的发言:

msgbox(IntPtr.Size)

 

如果是4,就是32位,如果是8,就是64位

 

袍爷,我的是win8.1企业版 x64 运行结果是 4……………………


--  作者:大红袍
--  发布时间:2016/6/2 20:41:00
--  

要添加 System.Management.Dll 引用

 

Dim oConn As New System.Management.ConnectionOptions()
Dim oMs As New System.Management.ManagementScope("\\\\localhost", oConn)
Dim oQuery As New System.Management.ObjectQuery("select AddressWidth fr om Win32_Processor")
Dim oSearcher As New System.Management.ManagementObjectSearcher(oMs, oQuery)
Dim oReturnCollection = oSearcher.[Get]()
Dim addressWidth As String = Nothing

For Each oReturn As object In oReturnCollection
   
    addressWidth = oReturn("AddressWidth").ToString()
Next
msgbox(addressWidth)

 

 

 


--  作者:jiskin
--  发布时间:2016/6/2 20:51:00
--  
以下是引用大红袍在2016/6/2 20:41:00的发言:

要添加 System.Management.Dll 引用

 

Dim oConn As New System.Management.ConnectionOptions()
Dim oMs As New System.Management.ManagementScope("\\\\localhost", oConn)
Dim oQuery As New System.Management.ObjectQuery("select AddressWidth fr om Win32_Processor")
Dim oSearcher As New System.Management.ManagementObjectSearcher(oMs, oQuery)
Dim oReturnCollection = oSearcher.[Get]()
Dim addressWidth As String = Nothing

For Each oReturn As object In oReturnCollection
   
    addressWidth = oReturn("AddressWidth").ToString()
Next
msgbox(addressWidth)

 

 

 

 

感谢袍爷! 问题解决了