서버가 32비트인지 64비트인지 확인

2034 단어 서버
// 32 64 

        private string Detect3264()

        {

            ConnectionOptions oConn = new ConnectionOptions();

            System.Management.ManagementScope oMs = new System.Management.ManagementScope("\\\\localhost", oConn);

            System.Management.ObjectQuery oQuery = new System.Management.ObjectQuery("select AddressWidth from Win32_Processor");

            ManagementObjectSearcher oSearcher = new ManagementObjectSearcher(oMs, oQuery);

            ManagementObjectCollection oReturnCollection = oSearcher.Get();

            string addressWidth = null;



            foreach (ManagementObject oReturn in oReturnCollection)

            {

                addressWidth = oReturn["AddressWidth"].ToString();

            }



            return addressWidth;

        }

좋은 웹페이지 즐겨찾기